Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel/JTabbedPane Focus question  RSS feed

 
Manny Garcia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have several JPanels inside a JTabbed pane and I want to capture the event when someone switches between the tabs. I'm using Netbeans 6.0. So far I've tried capturing the focus lost event in both the JTabbed pane and in the JPanels, but I'm not hitting them.

What event in which object(s) should I be looking for?

Regards,

Manny
 
Brian Cole
Author
Ranch Hand
Posts: 947
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manny Garcia:
I have several JPanels inside a JTabbed pane and I want to capture the event when someone switches between the tabs. I'm using Netbeans 6.0. So far I've tried capturing the focus lost event in both the JTabbed pane and in the JPanels, but I'm not hitting them.

What event in which object(s) should I be looking for?


Generally you would want to listen for changes to the tabbed pane's selection model. Something like:


[edit: This has nothing to do with Netbeans 6. Someone else will have to step in if you're looking for netbeans-specific information.]
[ January 20, 2008: Message edited by: Brian Cole ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!