Name: jk109818 Date: 04/29/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 :
unOS sparssun 5.7 Generic_106541-11 sun4u sparc
SUNW,Ultra-5_10
A DESCRIPTION OF THE PROBLEM :
(Please refer the source code I am sending.)
When a button is placed with TitleBorder in JPanel, it works
fine. But the same button with the same TitleBorder is
placed to JToolBar instead of JPanel. The TitleBorder is
totally ignored.
This behavior is NOT shown with JDK1.4 Linux platform but
it shows in JDK1.4 Solaris 7. This behavior was not shown
with JDK1.3.1 in Solaris 7, either.
I believe this is a bug in Solaris 7 JDK1.4.
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the provided code and run. It will show the
TitleBorder.
2. Comment out JPanel jToolBar = new jPanel()
3. uncomment JToolBar jToolBar = new jToolBar()
4. Compile and run the code. The TitleBorder will not be
shown.
EXPECTED VERSUS ACTUAL BEHAVIOR :
The TitleBorder should work either in JPanel or JToolBar.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import java.awt.*;
public class TitleBorderTest {
public static void main(String[] args) {
JFrame jFrame = new JFrame("Java 1.4 SDK Test");
//JToolBar jToolBar = new JToolBar();
JPanel jToolBar = new JPanel();
JButton jButton = new JButton();
jButton.setText("Test Button with Tool Bar");
LineBorder lineBorder = new LineBorder(Color.yellow,2);
TitledBorder uberBorder = new TitledBorder( lineBorder,
"Test",
TitledBorder.CENTER,
TitledBorder.BELOW_BOTTOM );
uberBorder.setTitleColor( Color.white );
jButton.setBorder(uberBorder);
jToolBar.add(jButton);
jFrame.getContentPane().add(jToolBar);
jFrame.show();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
In order to use JDK1.4 we are forced to use other operating
system such as Linux.
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: 146007)
======================================================================