read value from combobox.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chelvan
    New Member
    • Aug 2008
    • 90

    read value from combobox.

    hi all

    i face problem reading the JComboBox's selected item to a string variable.
    i'm trying like this;

    Code:
    String str=cmbname.getSelectedItem();
    its says error.
    so whats the way to read the selected item.


    thanks chel-1
  • r035198x
    MVP
    • Sep 2006
    • 13225

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

    Comment

    Working...