-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
tiger
-
x86
-
windows_2000
Name: gm110360 Date: 05/23/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-
b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version
5.00.2195]
A DESCRIPTION OF THE PROBLEM :
setBackground for JTabbedPane instances seems to have no effect.
setOpaque( true ) also has no effect. Both of
these routines worked
correctly in Java 1.3.1 but now fail.
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run code at bottom in Java 1.3.1
2. Run code at bottom in Java 1.4
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I expect that the JTabbedPane should be transparent when I perform
setOpaque( false ).
I think this has something to do with
JTabbedPane
now providing background across it's contentPanes, but
the ability to
make them transparent should be supported.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
// Have a ball!
import java.awt.*;
import javax.swing.*;
public class Main {
public
static void main( String argv[] ) {
JFrame frame = new JFrame( "Background frame" );
JPanel
panel = new JPanel( new BorderLayout());
panel.setBackground( Color.yellow );
panel.setPreferredSize( new Dimension( 200, 200 ) );
JButton opaqueButton = new
JButton(
"opaque button" );
opaqueButton.setBackground( Color.white );
opaqueButton.setOpaque( true );
JButton transparentButton = new JButton(
"transparent
button" );
transparentButton.setBackground( Color.white );
transparentButton.setOpaque( false );
JTabbedPane transparentTabbedPane = new
JTabbedPane();
transparentTabbedPane.setPreferredSize( new Dimension( 100, 100 ) );
transparentTabbedPane.setBackground( Color.green );
transparentTabbedPane.setOpaque( false );
JTabbedPane opaqueTabbedPane = new
JTabbedPane();
opaqueTabbedPane.setPreferredSize( new Dimension( 100, 100 ) );
opaqueTabbedPane.setBackground( Color.green );
opaqueTabbedPane.setOpaque( true
);
panel.add( opaqueButton, "North" );
panel.add( transparentButton, "South" );
panel.add( transparentTabbedPane, "East" );
panel.add( opaqueTabbedPane, "West" );
frame.getContentPane().add( "Center", panel );
frame.pack();
frame.show();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
No obvious workarounds
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 145189)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-
b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version
5.00.2195]
A DESCRIPTION OF THE PROBLEM :
setBackground for JTabbedPane instances seems to have no effect.
setOpaque( true ) also has no effect. Both of
these routines worked
correctly in Java 1.3.1 but now fail.
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run code at bottom in Java 1.3.1
2. Run code at bottom in Java 1.4
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I expect that the JTabbedPane should be transparent when I perform
setOpaque( false ).
I think this has something to do with
JTabbedPane
now providing background across it's contentPanes, but
the ability to
make them transparent should be supported.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
// Have a ball!
import java.awt.*;
import javax.swing.*;
public class Main {
public
static void main( String argv[] ) {
JFrame frame = new JFrame( "Background frame" );
JPanel
panel = new JPanel( new BorderLayout());
panel.setBackground( Color.yellow );
panel.setPreferredSize( new Dimension( 200, 200 ) );
JButton opaqueButton = new
JButton(
"opaque button" );
opaqueButton.setBackground( Color.white );
opaqueButton.setOpaque( true );
JButton transparentButton = new JButton(
"transparent
button" );
transparentButton.setBackground( Color.white );
transparentButton.setOpaque( false );
JTabbedPane transparentTabbedPane = new
JTabbedPane();
transparentTabbedPane.setPreferredSize( new Dimension( 100, 100 ) );
transparentTabbedPane.setBackground( Color.green );
transparentTabbedPane.setOpaque( false );
JTabbedPane opaqueTabbedPane = new
JTabbedPane();
opaqueTabbedPane.setPreferredSize( new Dimension( 100, 100 ) );
opaqueTabbedPane.setBackground( Color.green );
opaqueTabbedPane.setOpaque( true
);
panel.add( opaqueButton, "North" );
panel.add( transparentButton, "South" );
panel.add( transparentTabbedPane, "East" );
panel.add( opaqueTabbedPane, "West" );
frame.getContentPane().add( "Center", panel );
frame.pack();
frame.show();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
No obvious workarounds
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 145189)
======================================================================
- relates to
-
JDK-4261116 Transparent JTabbedPane doesn't fill in content area
- Resolved
-
JDK-4765304 JTabbedPane Color incorrect when using SCROLL_TAB_LAYOUT
- Closed
-
JDK-8078269 JTabbedPane UI Property TabbedPane.tabAreaBackground no longer works
- Resolved
-
JDK-4629510 REGRESSION: JTabbedPane does not support setOpaque(false)
- Closed
-
JDK-6462396 TabbedPane.contentOpaque doesn't work properly and is inconsistent across LAFs
- Closed
-
JDK-4685800 JTabbedPane.setOpaque(false) does not follow opacity rules
- Open
(1 relates to)