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 / February 2006

Tip: Looking for answers? Try searching our database.

JTabbedPane transparent background/opaque

Thread view: 
veryhairydog - 29 Jan 2006 16:24 GMT
Hi,
Has anyone figured out how to make tabAreaBackground transparent?  I
override the tabbedpaneUI#paintTabArea   like so:

protected void paintTabArea(Graphics g, int tabPlacement, int
selectedIndex) {
       int tw = tabPane.getBounds().width;
       int th = tabPane.getBounds().height;
       g.setColor(tabAreaBackground);

       g.fillRect(0, 0, tw, th);

       super.paintTabArea(g, tabPlacement, selectedIndex);
   }

WIth this I get control of the background tranparent Color(0,0,0,0)or
anyother color, however it doesnt do it right, in that it doesnt let
the background of the component beneath the tabbedpane to bleed thru.
There has to be a better way to set the tab area background to be
transparent.
Benoit Peltier - 30 Jan 2006 12:24 GMT
Have you tried ::

tabbedPane.setOpaque( false );

Benoit

> Hi,
> Has anyone figured out how to make tabAreaBackground transparent?  I
[quoted text clipped - 16 lines]
> There has to be a better way to set the tab area background to be
> transparent.
veryhairydog - 30 Jan 2006 15:19 GMT
yep...that be the first line i tried. however that only affects the
content background, not the tab background.
Andrey Kuznetsov - 31 Jan 2006 13:35 GMT
> yep...that be the first line i tried. however that only affects the
> content background, not the tab background.

are tabs wrapped or scrolled?

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

veryhairydog - 02 Feb 2006 06:48 GMT
tried both....same deal...
Andrey Kuznetsov - 02 Feb 2006 11:39 GMT
before painting you could try to get bounds rect of every tab and set clip
on Graphics.

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



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.