Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4183333

Please provide different WindowsLookAndFeel Border for JPopupMenu

XMLWordPrintable

    • beta
    • generic, x86
    • generic, windows_nt



      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)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            dmcduffisunw Dale Mcduffie (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: