You are using a JComboList?
check the reference:
javax.swing.JComboBox[
^]
There is a function
getSelectedIndex()
which returns an integer value. You sure know what to do with that.
Or - and that's the better method - you use the
getSelecetedItem()
which hands back any kind of Object. Background is that you can put Objects in the Combobox. For displaying a correct String in the Combobox the Object needs to implement the function
public String toString()
.
decide what you need - pushing a String into the JTextbox should not make Problems (otherwise ->
JAVA Swing GUI Tutorial @ oracle.com[
^] )