I am trying to find a way to close the window after clicking the JButtons. The OptionDialog doesn't close after I click. Here's what I have so far:
JButton[] option = new JButton[2];
option[0] = new JButton("X"); option[0].addActionListener(this);
option[1] = new JButton("O"); option[1].addActionListener(this);
JOptionPane.showOptionDialog(null, "Please choose!", "", 0, JOptionPane.DEFAULT_OPTION, null, option, null);
What could be a good approach for this?