I am using a JTabbedPane with 4 different tabs displaying a form on each. I have a button below the JTabbedPane that when pressed checks if all the required fields have been entered. If not then i use a JOptionPane to notify the user.
The problem is when the user clicks "OK" the JTabbedPane disappears and the screen is left with the contents of the first tab.
Problem is, each panel has its own class that extends JPanel. The JButton listener checks if the relevant fields have been complete on each JPanel by calling a method to each class.
I've tried relocating the JOptionPane.showMessageDialog() method to each of the JPanel classes instead of the JTabbedPane class but the same thing happens: the JTabbedPane disappears when the "OK" button is pressed. [ April 05, 2006: Message edited by: Ben Wong ]