Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old October 7th, 2008, 05:20 AM
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Age: 23
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, 07:18 AM
Administrator
 
Join Date: Sep 2006
Posts: 11,441
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 205,248 network members.