JDK-4183333 : Please provide different WindowsLookAndFeel Border for JPopupMenu
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.7,1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_nt
  • CPU: generic,x86
  • Submitted: 1998-10-21
  • Updated: 2001-06-29
  • Resolved: 2001-06-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.0 betaFixed
Related Reports
Duplicate :  
Description

Name: dm26566			Date: 10/21/98


[this RFE is being submitted without modification in order to capture
the enthusiam of the request.]

The simple BevelBorder of a JPopupMenu
with WindowsLookAndFeel looks unacceptable.
It should be a border like a JInternalFrame's one
with thickness of 3 pixels.

Please use the following border from now on:

  private class BBevelBorder extends Object implements Border, UIResource {

    private Insets ins = new Insets(3, 3, 3, 3);

    /*
     new BevelBorder(
       BevelBorder.RAISED,
       table.getColor("control"),
       //table.getColor("controlLtHighlight"),
       table.getColor("controlHighlight"),
       table.getColor("controlDkShadow"),
       table.getColor("controlShadow")
     )
     */
    public BBevelBorder() {
      super();
    }

    public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height) {
      //g.setColor(UIManager.getColor("controlShadow"));
      g.setColor(UIManager.getColor("control"));
      g.drawLine(x, y, x + width, y);
      g.drawLine(x, y, x, y + height);
      //PENDING: since Swing 1.1beta3 cLtHl
      g.setColor(UIManager.getColor("controlLtHighlight"));
      //g.setColor(UIManager.getColor("controlHighlight"));
      g.drawLine(x + 1, y + 1, x + 1 + width - 2, y + 1);
      g.drawLine(x + 1, y + 1, x + 1, y + 1 + height - 2);
      g.setColor(UIManager.getColor("control"));
      g.drawLine(x + 2, y + 2, x + 2 + width - 4, y + 2);
      g.drawLine(x + 2, y + 2, x + 2, y + 2 + height - 4);

      g.setColor(UIManager.getColor("control"));
      g.drawLine(x + 2, y + height - 3, x + 2 + width - 4, y  + height - 3);
      g.drawLine(x + width - 3, y + 2, x + width - 3, y + 2 + height - 4);
      g.setColor(UIManager.getColor("controlShadow"));
      g.drawLine(x + 1, y + height - 2, x + 1 + width - 2, y + height - 2);
      g.drawLine(x + width - 2, y + 1, x + width - 2, y + 1 + height - 2);
      g.setColor(UIManager.getColor("controlDkShadow"));
      g.drawLine(x, y + height - 1, x + width, y + height - 1);
      g.drawLine(x + width - 1, y, x + width - 1, y + height);
    }

    public java.awt.Insets getBorderInsets(java.awt.Component c) {
      return ins;
    }

    public boolean isBorderOpaque() {
      return true;
    }

  }
(Review ID: 40846)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

WORK AROUND Name: dm26566 Date: 10/21/98 Define your own look and feel, but this this should not be avoided if ever possible. ======================================================================
11-06-2004

EVALUATION Name: apC97674 Date: 11/05/99 The PopupMenu border of Windows LAF is really different from native Windows border. What submitter suggests is really a better match. ###@###.### ====================================================================== Name: apC97674 Date: 12/15/99 I compare BevelBorder on Windows LAF with native Win borders. The border suggested by submitter looks more close to native then current BevelBorder. ###@###.### ====================================================================== Lots of border fixes as part of a Windows LAF overhaul. Will be in workspace at the next promotion. mark.davidson@Eng 2000-06-01
01-06-2000