UIDefaults defaults = UIManager.getLookAndFeelDefaults();
    public void paintBorder(Component c, Graphics g, int x, int y, int w,         int h)    {              JInternalFrame f = (JInternalFrame) c;      g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());      if (f.getContentPane() instanceof JOptionPane)        {          JOptionPane pane = (JOptionPane) f.getContentPane();          int type = pane.getMessageType();          UIDefaults defaults = UIManager.getLookAndFeelDefaults();          if (type == JOptionPane.QUESTION_MESSAGE)            {              Color bc = defaults.getColor(                  "OptionPane.questionDialog.border.background");              if (bc != null)                g.setColor(bc);            }          if (type == JOptionPane.WARNING_MESSAGE)            {              Color bc = defaults.getColor(                  "OptionPane.warningDialog.border.background");              if (bc != null)                g.setColor(bc);                          }          else if (type == JOptionPane.ERROR_MESSAGE)            {              Color bc = defaults.getColor(                  "OptionPane.errorDialog.border.background");              if (bc != null)                g.setColor(bc);                          }        }            // fill the border background      g.fillRect(x, y, w, 3);      g.fillRect(x, y, 3, h);      g.fillRect(x + w - 3, y, 3, h);      g.fillRect(x, y + h - 3, w, 3);            // draw a dot in each corner      g.setColor(MetalLookAndFeel.getControl());      g.fillRect(x, y, 1, 1);      g.fillRect(x + w - 1, y, 1, 1);      g.fillRect(x + w - 1, y + h - 1, 1, 1);      g.fillRect(x, y + h - 1, 1, 1);          }