I have made a GUI in NetBeans. It's a chat program and i have 4 commandos like /join, /leave, /whisper and /leave

```
private void CommandoActionPerformed(java.awt.event.ActionEvent evt) {                                                 
        JOptionPane.showMessageDialog(rootPane, "The following commandos are:" + "\n" + "\n" + "/join Channel name" + "\n" + "/leave channel name" + "\n" + "/whisper nick message" + "\n" + "/quit - quit the program");
    }  

```

And this is OK, but i want actionlister instead of the showMessageDialog so i can push on of them and it comes in my JTextField. I think i can get them there but i don't know how to get the actionlistener combined with this.

EDIT: 
What i want is to push the Commando button and get up a windows where i have 4 new buttons, each with one commando (/join, /leave, /whisper and /exit) so when i push 1 of these buttons i get the commando in my text field so i just need to write the rest. 
So if i push the "/join" button, i just need to write the channel name.

EDIT2: If I was pretty bad in describing the problem, I can show what i wanted and have done so far:

```
 private void showCommandActionPerformed(java.awt.event.ActionEvent evt) {                                                 
        Object[] options = { "/join", "/leave", "/whisper", "/quit", "Ingenting" };

        int choice= JOptionPane.showOptionDialog(rootPane, "What do u want to do? ", null, WIDTH, WIDTH, null, options, rootPane);

        switch (choice) {
                case 0:
                    skrivTekst.setText("/Join ");
                skrivTekst.requestFocus();
                    break;
                case 1:
                    skrivTekst.setText("/Leave");
                skrivTekst.requestFocus();
                    break;
                case 2:
                    skrivTekst.setText("/Whisper");
                skrivTekst.requestFocus();
                    break;
                case 3:
                skrivTekst.setText("/Join ");
                skrivTekst.requestFocus();

                case 4:

                    System.exit(1); //this is wrong. i just want to close this window, not the whole program 
                default:

                    JOptionPane.showMessageDialog(null, "donno what!?!?!?!?!?!?!" + choice);
            }

    }                 

```

I hope this show what i wanted and what i have done. Ty to all :)
So the only problem i have left is closing the one JOptionPane window and not the program