g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1);
{ paintTitleBackground(g); paintChildren(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow());   g.drawLine(0, 0, 0, 0); g.drawLine(d.width - 1, 0, d.width - 1, 0);  g.drawLine(0, d.height - 1, d.width - 1, d.height - 1);   Rectangle b = title.getBounds(); int startX = b.x + b.width + 5; int endX = startX; if (iconButton.isVisible()) endX = Math.max(iconButton.getX(), endX); else if (maxButton.isVisible()) endX = Math.max(maxButton.getX(), endX); else if (closeButton.isVisible()) endX = Math.max(closeButton.getX(), endX); endX -= 7; if (endX > startX) MetalUtils.fillMetalPattern(g, startX, 3, endX - startX, getHeight() - 6, Color.white, Color.gray); } g.setColor(savedColor);
  public void paintComponent(Graphics g)  {    // probably need to check the isPalette flag here, if true pass over to    // paintPalette(Graphics)    super.paintComponent(g);    Dimension d = getSize();    if (frame.isSelected())      g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());    else      g.setColor(MetalLookAndFeel.getControlDarkShadow());    g.drawLine(0, d.height - 1, d.width - 1, d.height - 1);  }