Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTabbedPane Problem

 
Mahesh Kedari
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Mahesh Kedari
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic