• Post Reply Bookmark Topic Watch Topic
  • New Topic

TabbedPane SCROLL_TAB_LAYOUT

 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In netbeans3.6 on their tab layout just to the right of the left/right arrows for scrolling through the tabs they have a down arrow that popsup a a list of the tabs. Anyone know how they do that?

-Tad
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think www.netbeans.org is the best solution of your question.
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was hoping it was something simple, like the left/right buttons for scrolling the tabs (vs. the wrap-style layout). Or that someone here has implemented something similiar.

-Tad
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it would be too hard to write your own code to do this actually. You can get a list of all the tab titles, and put that into a combobox fairly easily. If you sub class JTabbedPane you can use the getTabCount() and getTitleAt(int i) methods to find the number and titles of the tabs. Put these into a String array and use that to construct a JComboBox. Then customise the rendering to display the combobox or button too.

Of course, you would have to update the combobox when a tab was added or removed as well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!