-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.2.0
-
None
-
sparc
-
solaris_2.6
With the Motif L&F, JTabbedPane.setBackgroundAt() does not work.
The following application attempts to display one tab out of 5 with
a blue background. When the app is executed, the tab is displayed with
the default background, and not with the expected blue background.
==========================================================================
/*
* tabTest.java
* Motif L&F: JTabbedPane.setBackgroundAt() does not work
*
*/
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
public class tabTest extends JFrame {
JTabbedPane tabbedPane;
public tabTest()
{
tabbedPane = new JTabbedPane();
for (int i = 0; i < 5; i++)
{
JPanel panel = new JPanel();
panel.add(new JLabel("The tab titled 'Tab2' should have a blue background."));
tabbedPane.addTab("Tab" + i, panel);
}
tabbedPane.setSelectedIndex(3);
tabbedPane.setBackgroundAt(2,Color.blue);
tabbedPane.setForegroundAt(1,Color.green);
getContentPane().setLayout(new BorderLayout());
getContentPane().add("Center", tabbedPane);
}
public static void main(String[] args)
{
tabTest frame = new tabTest();
frame.pack();
frame.setSize(450,350);
frame.show();
}
}
- relates to
-
JDK-4120383 Metal L&F: JTabbedPane.setBackgroundAt() does not work
-
- Closed
-