[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Execute instructions before JTabbedPane change of tabulation

Posted on 2006-04-25
6
Medium Priority
?
236 Views
Last Modified: 2010-03-31
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.
0
Comment
Question by:matthew016
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 16532780
>>everything is lost.

Why so?

You could use a ChangeListener, but at the moment, i don't see why you need to
0
 
LVL 9

Author Comment

by:matthew016
ID: 16532901
That's the way my programs works.
I can't really explain this shortly.
But in my tabulations I have JPanels but they have not the method addChangeListener.
0
 
LVL 9

Author Comment

by:matthew016
ID: 16532925
I see that I can use ComponentListener
componentHidden(ComponentEvent e)
componentShown(ComponentEvent e)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:matthew016
ID: 16532955

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 ?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16533338
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
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16563039
:-)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question