Name: rmT116609 Date: 04/06/2003
FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)
FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
This problem only occurs with the new Windows XP Look&Feel bundled with the J2SDK1.4.2-beta-b19:
When creating a JToolBar and adding some buttons to it, one button will always appear to paint a rollover-effect (raised border) even if you move the mouse away. When you press another button, then this one starts displaying the effect (While you have the mouse over another button, the border is painted for both). At least it looks like the rollover effect, except the normal icon, not the rollover-icon, is used. Additionally, when the containing window loses the focus, the effect disappears.
I believe this is a bug, because I didn't experience such a behavior with other L&Fs.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the source code or simply create a JFrame with a JToolBar and put some buttons in the latter. Select the Windows L&F and run with J2SDK1.4.2-beta
EXPECTED VERSUS ACTUAL BEHAVIOR :
No button should paint a rollover-effect until moving the cursor over it.
After starting, Button1 will seem to paint a rollover-effect even if it never has been "touched" with the mouse cursor. After a click on Button2, this one will seem to be selected.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Use this sample app:
import javax.swing.*;
public class TestApplication {
public static void main( String[] args ) throws Exception {
String winLAF = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
UIManager.setLookAndFeel( winLAF );
JFrame frame = new JFrame();
JToolBar toolbar = new JToolBar();
JButton btn1 = new JButton( "Button1" );
JButton btn2 = new JButton( "Button2" );
toolbar.add( btn1 );
toolbar.add( btn2 );
frame.getContentPane().add( toolbar );
frame.pack();
frame.setVisible( true );
}
}
---------- END SOURCE ----------
(Review ID: 183617)
======================================================================