If you need the text that is selected on the JComboBox , and you are sure that it is a String , not some other object, just use something like String text = (String)myCombobox.getSelectedItem() . If the thing you have in the Model is different from String , you need to pass it to the appropriate class, and then use the toString() method of this object. If you need more help, you should embed a little of your code, at least the declaration and commissioning of your JComboBox ...
Federico vera
source share