• 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 events

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm writing an application using JTabbedPane components. I can generate
and display the JTabbedPane's fine, but what type of event is generated
when a user clicks on one of the tabs...
I have a listener class created which implements ChangeListener, but that's
only going to capture changes such as scrolling on the tabpane(s).
So how do I know when to do/display, etc. data based on the tab selected?
Thanks....
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, you get ChangeEvents from a JTabbedPane when the selected panel changes -- try it. When you get the event, call getSelectedIndex() on the tabbed pane to find out what the new selection is.
 
reply
    Bookmark Topic Watch Topic
  • New Topic