Squeeze tabs closer together in JTabbedPane??  
Author Message
brightoceanlight





PostPosted: 2005-8-5 16:47:00 Top

java-programmer, Squeeze tabs closer together in JTabbedPane?? Is there a way to squeeze the tabs closer together in a JTabbedPane? I
noticed there is some free space in the tab itself to the right of the
text in the tab. Don't want to overhaul the look of the GUI. Just want
to move the tabs closer together. An option I thought of, don't know
if it's the best, is to make the tab text image icons and show the
icons instead of text. Don't know if this will free up space.

 
Thomas Fritsch





PostPosted: 2005-8-6 1:42:00 Top

java-programmer >> Squeeze tabs closer together in JTabbedPane?? email***@***.com wrote:
> Is there a way to squeeze the tabs closer together in a JTabbedPane? I
> noticed there is some free space in the tab itself to the right of the
> text in the tab. Don't want to overhaul the look of the GUI. Just want
> to move the tabs closer together. An option I thought of, don't know
> if it's the best, is to make the tab text image icons and show the
> icons instead of text. Don't know if this will free up space.
>

Yes, I'm pretty sure that it would free some space. Just try out the
various JTabbedPane#addTab methods.

Another option might be setting a smaller font onto the JTabbedPane, for
example: yourTabbedPane.setFont(Font.decode("Dialog-9"));

--
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

 
Vova Reznik





PostPosted: 2005-8-6 2:08:00 Top

java-programmer >> Squeeze tabs closer together in JTabbedPane?? email***@***.com wrote:
> Is there a way to squeeze the tabs closer together in a JTabbedPane? I
> noticed there is some free space in the tab itself to the right of the
> text in the tab. Don't want to overhaul the look of the GUI. Just want
> to move the tabs closer together. An option I thought of, don't know
> if it's the best, is to make the tab text image icons and show the
> icons instead of text. Don't know if this will free up space.
>

Check out UIManager.get("TabbedPane.tabAreaInsets");
UIManager.get("TabbedPane.tabInsets");
By default tabInsets is (2, 2, 0, 6), there 6 = right

You can set those properites (java.awt.Insets).
Don't forget to call SwingUtilities.updateComponentTree(Component);
 
 
brightoceanlight





PostPosted: 2005-8-6 18:46:00 Top

java-programmer >> Squeeze tabs closer together in JTabbedPane?? Thanks for the replies!

>Check out UIManager.get("TabbedPane.tabA璻eaInsets");
> UIManager.get("TabbedPane.tabI璶sets");
>By default tabInsets is (2, 2, 0, 6), there 6 = right
>
>You can set those properites (java.awt.Insets).
>Don't forget to call SwingUtilities.updateComponent璗ree(Component);
>

How can I change the settings? There isn't a set() command for the
UIManager??

Thank you,

Gil

 
 
IchBin





PostPosted: 2005-8-6 20:34:00 Top

java-programmer >> Squeeze tabs closer together in JTabbedPane?? email***@***.com wrote:
> Thanks for the replies!
>
>> Check out UIManager.get("TabbedPane.tabA璻eaInsets");
>> UIManager.get("TabbedPane.tabI璶sets");
>> By default tabInsets is (2, 2, 0, 6), there 6 = right
>>
>> You can set those properites (java.awt.Insets).
>> Don't forget to call SwingUtilities.updateComponent璗ree(Component);
>>
>
> How can I change the settings? There isn't a set() command for the
> UIManager??
>
> Thank you,
>
> Gil
>

Because it is a put

public static Object put(Object key, Object value)

Check the UIManager in the SDK.
--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com
__________________________________________________________________________

' If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)