Forums Register Login

JTabbedPane Problem

+Pie Number of slices to send: Send
Hi all,
Im designing a desktop application. Im using JTabbedPane for forms.
I wanted to show a popup message to user when he leaves current tab unsaved.
Im able to monitor tab switching even using ChangeListener(), but im unable to handle the event when user clicks on any other JXTaskPane shortcut or Menu Item.
Can anyone please suggest me?
+Pie Number of slices to send: Send
What happens if the user clicks on some menu? Does it change the UI which effectively means the user leaves the tabbed pane in an unsaved state of data??
+Pie Number of slices to send: Send
Yes Maneesh,
In my application, i have multiple forms, such as Vendor details, customer details, product details etc.
If I am on Vendor details form, creating new vendor, for example, Then without saving this form,I am selecting some other form, lets say customer details.
for loading new form, I am removing current JTabbedPane from current panel and creating new instance of JTabbedPane.

I want to check this event and display a pop up before loading new screen/form.
Also if saving fails due to some reason, user should stay on same screen/form.
+Pie Number of slices to send: Send
Well you can have some boolean which indicates the unsaved data state. In all your actions which change the UI, like menus and shortcuts etc you can check this boolean and process accordingly.
There might be something else on the lines of component will become invisible but I am too rushed to hunt for it right now.
I knew that guy would be trouble! Thanks tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1233 times.
Similar Threads
JOptionPane affecting JTabbedPane
JtabbedPane Question
show OptionDialog without JTabbedPane changing tab
How to use getModel() with JTabbedPane ?
Confused Project?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:44:47.