• Post Reply Bookmark Topic Watch Topic
  • New Topic

In a tabbed pane, how do i fix the width of the tab  RSS feed

 
Smriti Anchu
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a tabbed pane. The title in one of the tabs keeps changing based on the name selected. I want this to be fixed to some characters. Right now i have the title to be 33 characters. If the name is less than 33 characters, i am concatenating the remaining length with a space (" ") character.

As the width of some characters are different (variant), the tab moves a bit right or left.

How do i fix the width of the tab title so it doesnt even move a bit also.

thanks
smriti
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way I'm aware of to do this is a bit ugly. You can replace the default TabbedPaneUI your Look & Feel installs on the JTabbedPane with your own subclass of BasicTabbedPaneUI that overrides the calculateTabWidth() method. If your Look & Feel decorated tabs the decorations will be gone.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!