Connecting Tech Pros Worldwide Help | Site Map

read value from combobox.

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 7th, 2008, 04:20 AM
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Age: 24
Posts: 86
Default read value from combobox.

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
Reply
  #2  
Old October 7th, 2008, 06:18 AM
Administrator
 
Join Date: Sep 2006
Posts: 11,941
Default

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.