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.
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.
subject: In a tabbed pane, how do i fix the width of the tab