• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTabbedPane Problem

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic