• Post Reply Bookmark Topic Watch Topic
  • New Topic

please help....

 
vikas de
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys..
i have a prob with the JComboBox...please see the code
JComboBox cb=new JComboBox();
cd.addItem("test");
please tell me know how to get the String which will be displayed in the combox...!??? the getselected method only return a int as value...
Thanx a lot...
vikas
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vikas,
You can use that
String item = (String)cb.getSeletedeItem();
It will be working!!
Good luck.

Ken

Originally posted by vikas de:
hi guys..
i have a prob with the JComboBox...please see the code
JComboBox cb=new JComboBox();
cd.addItem("test");
please tell me know how to get the String which will be displayed in the combox...!??? the getselected method only return a int as value...
Thanx a lot...
vikas

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!