Yes, you're collecting and printing the selected index. You want the item at the index, not the index itself.
Type: Posts; User: GregBrannon
Yes, you're collecting and printing the selected index. You want the item at the index, not the index itself.
Different components have different ways to clear them. If the component has a setText() method, you can clear by calling theComponent.setText( "" ); // empty quotes. If you've provided a blank...
getSelectedIndex() returns the index of the selected item. In other words, the 5th item in the JComboBox might be 20.00. getSelectedIndex() returns '4' (the 5th item), not 20.00. Review the...