United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4183333 : Please provide different WindowsLookAndFeel Border for JPopupMenu

Details
Type:
Enhancement
Submit Date:
1998-10-21
Status:
Resolved
Updated Date:
2001-06-29
Project Name:
JDK
Resolved Date:
2001-06-29
Component:
client-libs
OS:
windows_nt,generic
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.1.7,1.3.0
Fixed Versions:
1.4.0 (beta)

Related Reports
Duplicate:

Sub Tasks

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


                                     
2004-06-14
WORK AROUND



Name: dm26566			Date: 10/21/98


Define your own look and feel, but this this
should not be avoided if ever possible.
======================================================================
                                     
2004-06-11
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
                                     
2000-06-01



Hardware and Software, Engineered to Work Together