Mar 11, 2002 #1 johnnyv Programmer Jul 13, 2001 216 CA I am new to Java and need to empty out a choice box when the user presses a command button I have the action listener working but am unsure of the syntax to empty out the choice box thanks
I am new to Java and need to empty out a choice box when the user presses a command button I have the action listener working but am unsure of the syntax to empty out the choice box thanks
Mar 12, 2002 #2 dddutcher Programmer Oct 3, 2001 5 US Assuming you are using a JComboBox, you can use the following lines of code (without the first line, IE and NS may throw an exception). if (comboBox.getItemCount() > 0) comboBox.removeAllItems(); Upvote 0 Downvote
Assuming you are using a JComboBox, you can use the following lines of code (without the first line, IE and NS may throw an exception). if (comboBox.getItemCount() > 0) comboBox.removeAllItems();