Look at the example programs in the tutorial.
Type: Posts; User: Norm
Look at the example programs in the tutorial.
Write it into a program and compile it. The compiler will tell you if you have coded it correctly.
Here's some links to the tutorial:
How to Make Dialogs (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
How to Use Modality in Dialogs (The Java™ Tutorials > Creating...
Create a JDialog window, add the combo box to it and show it. When the user closes the JDialog window, get the user's input to the dialog and use it as you want.
Is the red X what closes the JFrame window? The posted close exits the program when the JFrame is closed.
You probably want to use a modal JDialog window to display the combo box. When that...
When does a combo box close? How can a user close a combo box? What would a user do to close it?
When does the combo box close? The sample code you posted always shows the combo box.
Can you explain the sequence of events you want the user to see?