Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to load tab content upon clicking the tab in JTabbedPane?

 
nagendra bvvs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Could you please help me in this?

Requirement:
I would like to load content of a tab once after user clicks on particular tab in JTabbedPan. (Based on tab selection).
Do we have onclick event on tab (in JTabbedPan)?

Eg: My JTabbedPan contains tabs Tab1,Tab2,Tab3.
So, if user clicks on tab2 it starts loading the tab and adds component to tab2. simillarly for tab1 and tab3.

Is this possible??? If so kindly help/guide me. (Any related information or article is most welcome).

Thanks in advance.

 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Based on tab selection"... does that mean you are actually interested in when a tab is selected? In that case just add a ChangeListener to the JTabbedPane and it will be notified whenever a new tab is selected.
 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"nagenda bvvs", please check your private messages regarding an important administrative matter.

Thank you.
 
nagendra bvvs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.
ChangeListener has gave solution for my requirement.

Thank you so much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic