• 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

Can't trigger the ChangeListener

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this method, I tried to select the currently selected panel, then select the index 0 JPanel
and re-select the current one to simulate the ChangeListener event,
However, when the user comes back from a JDialog, I don't have this opportunity to do so,
How do I trigger the ChangeListener of the tabbedPane (JTabbedPane) conveniently?
Thanks
Jack

 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I completely understand what it is you're trying to accomplish or why, but it seems like you could add a WindowListener to the JDialog which in the windowClosed() method uses a reference to the JTabbedPane to retrieve all its associated ChangeListeners via the getChangeListeners() method. You could then simply invoke each of the stateChanged() methods with your own ChangeEvent.

I'm still a bit puzzled as to why you would want to fire a ChangeEvent if the tab selection wasn't changed, though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic