Connecting Tech Pros Worldwide Help | Site Map

read value from combobox.

  #1  
Old October 7th, 2008, 05:20 AM
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Posts: 86
hi all

i face problem reading the JComboBox's selected item to a string variable.
i'm trying like this;

Expand|Select|Wrap|Line Numbers
  1. String str=cmbname.getSelectedItem();
  2.  
its says error.
so whats the way to read the selected item.


thanks chel-1
  #2  
Old October 7th, 2008, 07:18 AM
Lives Here
 
Join Date: Sep 2006
Posts: 12,085

re: read value from combobox.


If you read the Javadocs for that class you will see that that method returns an Object.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting value from combobox KSor answers 3 August 6th, 2008 02:45 PM
How to read a value from a WebCombo (Infragistics)? Oliver Orsteck answers 0 November 19th, 2005 11:56 PM
Repost (corrected explanation): Lengthy Error from Combobox Susan Bricker answers 2 November 13th, 2005 12:25 PM