JDK-4844442 : REGRESSION: JToggleButton in JToolbar has no border when setRollover(true)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • 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
Related Reports
Relates :  
Description

Name: jk109818			Date: 04/07/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 2000 [Version 5.00.2195]


EXTRA RELEVANT SYSTEM CONFIGURATION :
Using Windows Look and Feel.  Have tried using command line switch to disable XP look and feel enhancements- it makes no difference.

A DESCRIPTION OF THE PROBLEM :
If a JToggleButton is added to a JToolBar and the toolbar is operating in   setRollover(true) mode, the toggle button's behaviour is wrong.

In 1.4.1, the button would retain its lowered bevel border when it is "selected".  This is the correct behaviour.  JToggleButton, must, by its very nature, have a distinct state for on and off.  In a rollover-style toolbar, the "!selected" state is no border painted.  The "selected" state is a lowered bevel painted.

The behaviour in 1.4.1 was correct and matched how Windows itself handles toolbars.  My Guess is the L&F updates in 1.4.2 Beta have broken this.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create toolbar
setRollover(true)
Add JToggleButton

EXPECTED VERSUS ACTUAL BEHAVIOR :
JToggleButton should have no border when off, and a lowered bevel border when on.
JToggleButton has no border when off or on.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Workaround would be to code your own MouseListener and not use the setRollover(true) on JToolBar.

Release Regression From : 1.4.1_02
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: 183518) 
======================================================================

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
14-06-2004

EVALUATION The border for a selected JToggleButton with rollover enabled is not being painted. This is an effect of the fix for bug 4735514 which changed the border to implement UIResource. This caused the code in WindowsToggleButtonUI.paintButtonPressed() to not be executed. The fix is to handle the painting in the BasicBorders class. We should investigate if the old code can be removed from WindowsToggleButtonUI. ###@###.### 2003-04-22
22-04-2003