Name: rlT66838 Date: 08/09/99
I'd like to make my JTabbedPane transparent, so the background shows up in the area around the tabs (e.g. the area to the right of the tabs, when the tabs are in the upper-left corner). But when I do this, the tabbed pane's content area becomes transparent too. This is not the right thing - it breaks the abstraction that this is an actual panel that other things can be placed on. It now looks like it's got a hole in the middle. What's more, if I try to get rid of the hole by placing an opaque JPanel on each tab pane, there's a ring of transparency around each of my JPanels. This seems to be a no-man's land which is not painted either by the JTabbedPane or its contents.
public class TabTest2
public final static void main (String args)
// Create frame
JFrame f = new JFrame("hi");
JPanel p = new JPanel();
// Create tab pane
JTabbedPane t = new JTabbedPane();
t.setBounds(50, 50, 300, 200);
JLabel x = new JLabel("transparent");
JLabel y = new JLabel("opaque");
// Show the frame.
(Review ID: 93708)