Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4183333
Votes 0
Synopsis Please provide different WindowsLookAndFeel Border for JPopupMenu
Category java:classes_swing
Reported Against 1.1.7 , kestrel-beta
Release Fixed 1.4(merlin-beta)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 4285463
Submit Date 21-OCT-1998
Description




[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)
======================================================================
Work Around




Define your own look and feel, but this this
should not be avoided if ever possible.
======================================================================
Evaluation




The PopupMenu border of Windows LAF is really different from native
Windows border. What submitter suggests is really a better match.

 xxxxx@xxxxx 

======================================================================




    I compare BevelBorder on Windows LAF with native Win borders.
The border suggested by submitter looks more close to native then
current BevelBorder. 

 xxxxx@xxxxx 

======================================================================

Lots of border fixes as part of a Windows LAF overhaul. Will be in workspace at the next promotion.
 xxxxx@xxxxx  2000-06-01
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang