I have a JFrame have "Add new user" button, a AddUser class which extends JPanel
Inside of AddUser class have name, job,....,Add and "Clear all" buttons
I'm using showOptionDialog to open AddUser
AddUser addPanel = new AddUser();
JButton[] temp = new JButton[1];
temp[0] = AddUser.jButton1; //this is add button
int option = JOptionPane.showOptionDialog(rootPane, addPanel,"Add new user"
,JOptionPane.YES_OPTION, JOptionPane.INFORMATION_MESSAGE, null, temp, null);
the showOptionDialog require Object[] so I created JButton[] then throw add button in
It does open add pane but when I click add button, the pane doesn't turn off