United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4843580 : XP L&F: Always one button with rollover in JToolBar with WinXP Look & Feel

Details
Type:
Bug
Submit Date:
2003-04-07
Status:
Resolved
Updated Date:
2003-05-13
Project Name:
JDK
Resolved Date:
2003-04-29
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
1.4.2 (b22)

Related Reports
Backport:

Sub Tasks

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
EVALUATION

Toolbar button painting is wrong. Should not paint focus.
###@###.### 2003-04-17
                                     
2003-04-17
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



Hardware and Software, Engineered to Work Together