Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

JTabbedPane grey line between tab and contents?

Thread view: 
Jaap Zeerijk - 10 May 2005 10:54 GMT
Hello,

I've got a problem with coloring a jtabbedpane:

I've done a:
panel.setBackground(c);
to change to background of the panel (the content of the jtabbedpane).
and a:
tpmain.setBackgroundAt(i, c);
to change the background a a specific tab.

But as illustrated on the screenshot:
http://img143.echo.cx/img143/2648/tab4qt.gif
there is a grey 2 pixel line between the tab and the tab contents.

How can i remove this grey line?

Kind regards,

Jaap Zeerijk
Thomas Weidenfeller - 10 May 2005 11:02 GMT
> Hello,
>
[quoted text clipped - 6 lines]
> tpmain.setBackgroundAt(i, c);
> to change the background a a specific tab.

I would guess (and it is only a guess) that this is the foreground color
of the JTabbedPane. What happens if you change that color?

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq

Jaap Zeerijk - 10 May 2005 11:14 GMT
>> Hello,
>>
[quoted text clipped - 9 lines]
>I would guess (and it is only a guess) that this is the foreground color
>of the JTabbedPane. What happens if you change that color?

Not much ;-)

tpmain.setForeground(Color.green);
panel.setForeground(Color.green);
tpmain.setForegroundAt(i, Color.green);

The line stays grey.

Jaap Zeerijk
John McGrath - 11 May 2005 21:34 GMT
> I've got a problem with coloring a jtabbedpane:

> there is a grey 2 pixel line between the tab and the tab contents.
>
> How can i remove this grey line?

That is the content border area.  There is no public JTabbedPane
properties that control this, but it can be controlled using the
UIDefaults table.  If you want to make changes for a single JTabbedPane,
you will have to adjust the UIDefaults when the UI delegate is installed
and then adjust it back.  Otherwise, you can just change the UIDefaults as
desired.

The size of the line is controlled by the "TabbedPane.contentBorderInsets"
UIDefaults property.  The color of the line that you refer to is
controlled by "TabbedPane.contentAreaColor", but other lines are drawn in
that insets area as well.  Setting the insets to [1,1,1,1] should get rid
of most of the line, but you will still be left with a 1-pixel wide line
at the bottom of the selected tab.

You can set the color of that line with "TabbedPane.contentAreaColor".  If
you delete "TabbedPane.contentAreaColor" from the UIDefaults table, it
will paint the same color as the selected tab.

Signature

Regards,

John McGrath



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.