jcombobox

Hi,does any one know how to close a jframe using the itemstatechanged method of jcombobox. I want to clase a frame when i change the item state of a jcombobox.Any help will be appreciatedThanks
[221 byte] By [minza] at [2007-11-27 2:38:50]
# 1
Rather weird requirement.My guess is that you are selecting an item "CLOSE" or some such in the JComboBox.Use an ActionListener and if the item selected equals close, call dispose(); or setVisible(false); depending on what you want.
filestreama at 2007-7-12 3:00:21 > top of Java-index,Java Essentials,Java Programming...
# 2
sorry,i wasnt being clear enough, when i select an item from the combobox, a new jframe opens, but i want the old one to disappear, but it doesnt seem to work with this.dispose(), the old frame sits behind the new oneAny ideas
minza at 2007-7-12 3:00:21 > top of Java-index,Java Essentials,Java Programming...
# 3

First, this is a Swing question and should be placed in the Swing forum.

Second, my guess is that you've got a few issues going on with your code including not calling setVisible() or dispose() correctly and focus traversal problems.

At the moment, I can't be bothered with your code as I am discussing Night Ranger, Loverboy, and Quarterflash. Post a small sample of code in the Swing forum. They'll sort you out.

Good luck.

filestreama at 2007-7-12 3:00:21 > top of Java-index,Java Essentials,Java Programming...