matthew016
asked on
Execute instructions before JTabbedPane change of tabulation
Hi,
I use JTabbedPanes,
in one of them the user can do operations that need to be saved (JButton Save).
But if he choose another Tabulation without saving everything is lost.
How can I ask the user to save the operations before the JTabbedPane change of Tabulation ?
Thank you for any help.
I use JTabbedPanes,
in one of them the user can do operations that need to be saved (JButton Save).
But if he choose another Tabulation without saving everything is lost.
How can I ask the user to save the operations before the JTabbedPane change of Tabulation ?
Thank you for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I see that I can use ComponentListener
componentHidden(ComponentE vent e)
componentShown(ComponentEv ent e)
componentHidden(ComponentE
componentShown(ComponentEv
ASKER
Ok I have several problems when I use a ComponentListener:
1.The event is called after the tab is changed, so I have my JOptionPane above the new tab clicked.
2.I tought I could ask the user to Save with options Yes, No, Cancel
And when he clicks cancel the tab shouldn't change, do u think it is possible to do that ?
It's difficult to assist you only knowing the vaguest details. Suffice it to say at this stage that it's possible to autosave continuously, which i would imagine would cure the problem
:-)
ASKER
I can't really explain this shortly.
But in my tabulations I have JPanels but they have not the method addChangeListener.