JDK-4843580 : XP L&F: Always one button with rollover in JToolBar with WinXP Look & Feel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-04-07
  • Updated: 2003-05-13
  • Resolved: 2003-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 b22Fixed
Description

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) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis-rc tiger FIXED IN: mantis-rc tiger INTEGRATED IN: mantis-b22 mantis-rc tiger tiger-b07
2004-06-14

EVALUATION Toolbar button painting is wrong. Should not paint focus. ###@###.### 2003-04-17
2003-04-17