Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

close JTabbedPane  RSS feed

 
karl nilsson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm working on a project that will require either multiple tabs, or multiple windows (the number will change frequently). The problem with using multiple tabs is closing them. I know that in java se 6 there will be support for using components (such as a close button) in the tabbed pane's title bar, but that is still not officially released yet. So my question is, should I wait for jse 6 and give up on compatibility (from previous releases), or should I not use tabbed panes, or is there some way to add closing functionality to a tabbed pane?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can add an icon to the tab (perhaps a small X), and a mouseListener
to close the tab if the icon is clicked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!