JDK-4129699 : Motif ButtonUI: Whenever button is pressed focus is painted(paintFocus is false)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-04-16
  • Updated: 1998-06-01
  • Resolved: 1998-06-01
Related Reports
Relates :  
Description
Swing-1.0.2: I have one comment on painting focus logic of motif look JButton.

From the line 219 of MotifBorderFactory, hasfocus is always true whenever the 
button is pressed even though focusPaint is false. hasfocus is used to see if 
focus has to be painted or not. 

How about:
hasFocus = b.isFocusPainted() && b.hasFocus();

If button's focusPaint is false, focus should not be painted even though button is pressed.
(Window and Metal ButtonUI follows this well)  
bae-chul.kim@eng 1998-04-16

Comments
EVALUATION The code has been changed between 1.0.2 and 1.1 that this comment no longer applies. sky 1998-06-01
11-06-2004

PUBLIC COMMENTS The code has been changed between 1.0.2 and 1.1 that this comment no longer applies. sky 1998-06-01
10-06-2004

SUGGESTED FIX From the line 219 of MotifBorderFactory: ButtonBorder class handles painting focus of JButton. hasFocus = b.isFocusPainted() && b.hasFocus(); (This will make consistency with metal and window look JButton's painting behavior. In metal/window, if the upper condition is true, focus is painted no matter what the button is pressed.) bae-chul.kim@eng 1998-04-17
17-04-1998