setting default JComboBox selected

i have a clear button that i when i click it i want it to reset the JComboBox back to the first item in the JComboBox. i'm trying to use setSelectedIndex or setSelectedItem and either one i use causes the program to flip out like crazy. does anyone have any ideas on how to get this to
[299 byte] By [speedy11309a] at [2007-10-2 11:55:03]
# 1

Swing related questions should be posted in the Swing forum.

comboBox.setSelectedIndex(0);

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.

camickra at 2007-7-13 8:06:38 > top of Java-index,Java Essentials,Java Programming...