Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get data type of the selected item of JComboBox in java

843806Oct 23 2008 — edited Oct 23 2008
Hello,

As the getSelectedItem(); method of jComboBox return the Item with Object data type. I want to convert this Data type into premitive or non-premitive data type. How could I do this. For example I get the selected Item and now I want to convert this into String. How could I accomplish this. I have tried to use Wrapper Classes but of no use as it gives an error.

Actually I want to get selected Item but not with object data type but with other (premetive preferalbe).Kindly help me in this regards.

Thanks,

Danish Kamran
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2008
Added on Oct 23 2008
2 comments
452 views