Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old October 7th, 2008, 05:20 AM
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Age: 23
Posts: 84
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,312
Default

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

Bookmarks

Thread Tools

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles