JDK-4254444 : Swing's Windows L&F has a some interface bugs
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.7,1.2.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-07-15
  • Updated: 2001-11-13
  • Resolved: 2001-11-13
Related Reports
Duplicate :  
Description

Name: skT88420			Date: 07/15/99


The Windows L&F has a few interface bugs that should be really easy to fix:

1. The combobox background color seems to be hardcoded to white instead of using the system window color

2. The scrollpane border should be the same as the textfield border

3. The popupmenu border should be the same as the non-default button border

4. The button border's highlight isn't correct - the light highlight color should be on the inside rather than on the outside
(Review ID: 85595) 
======================================================================

Name: skT88420			Date: 07/15/99


> Hi. We're using the Windows L&F in software we're writing,
> and we find that there are many things that are quite unlike
> Windows. Most of us are actually from Unix backgrounds,
> but even we notice the problems.
> 
> The main trouble is with borders. The JButton border is
> correct, as far as we can see. The TableHeader.cellBorder
> is incorrect, and ought to be the same as the Button.border.
> The following work-around fixes this, but you might want
> to fix it in the WindowsLookAndFeel class:
> 
>         UIManager.put("TableHeader.cellBorder",
>                 UIManager.get("Button.border"));
> 
> The pop-up menu border is also wrong. I'm not certain
> that the button's border is exactly right, but it's a lot
> closer. PopupMenu.border should also be modified as
> above.
> 
> The body of the tabbed pane also has too thick a
> border: one that doesn't even fit the border used on
> the little "ears" at the top, which looks particularly
> bad.
> 
> JTable is the real problem, though. When in a scroll-pane,
> it has the annoying habit of having a non-null border
> and viewport border. Worse still, calling setBorder(null)
> and setViewportBorder(null) doesn't work, and one has
> to create a new border of zero-width. That is silly,
> particularly because a Windows program wouldn't have
> a border here.
> 
> Then there's the problem of the cell focus highlighting:
> the yellow LineBorder. Windows has the dotted rectangle
> that you use on buttons and selected tabs, not a solid
> yellow rectangle. Moreover, the way Swing tries to
> implement this is flawed: it's not OK to simply add a
> border to a cell in the case of row selection. This needs
> to be done differently before you can properly implement
> the Windows look and feel.
> 
> Other kinds of defaults should depend on the look & feel:
> things like whether grid lines are shown in tables, and
> the cell spacing (not, and none, respectively for Windows).
> 
> As an aside, why does Swing draw checkboxes and
> up and down arrows, rather than using images? Would
> images not be faster? I'm glad of Swing, but its
> performance often leaves a lot to be desired, and every
> little would help.
> 
> My application now looks almost exactly as an equivalent
> written with Visual C++ would, but it required more work
> than it ought to have done.
> 
> I never thought I'd be asking for Windows to be taken
> more seriously!
(Review ID: 85602)
======================================================================

Comments
WORK AROUND Name: skT88420 Date: 07/15/99 1. UIManager.put( "ComboBox.background", new ColorUIResource(UIManager.getColor("TextField.background")) ); 2. UIManager.put( "ScrollPane.border", new BorderUIResource(UIManager.getBorder("TextField.border")) ); 3. UIManager.put( "PopupMenu.border", new BorderUIResource(UIManager.getBorder("Button.border")) ); 4. No easy workaround for 4 ====================================================================== Name: skT88420 Date: 07/15/99 See above. (Review ID: 85602) ======================================================================
11-06-2004

EVALUATION Many of these issues have been addressed in the Windows LAF update for 1.4. Most of the work was covered under the bug 4268204. ###@###.### 2001-11-12
12-11-2001