Java Swing 3D Border drawFlush3DBorder(Graphics g, int x, int y, int w, int h)

Here you can find the source of drawFlush3DBorder(Graphics g, int x, int y, int w, int h)

Description

This draws the "Flush 3D Border" which is used throughout the Metal L&F

License

Open Source License

Declaration

static void drawFlush3DBorder(Graphics g, int x, int y, int w, int h) 

Method Source Code

//package com.java2s;

import javax.swing.plaf.metal.MetalLookAndFeel;
import java.awt.*;

public class Main {
    /**/* ww  w .  j  ava  2 s  .  c  om*/
     * This draws the "Flush 3D Border" which is used throughout the Metal L&F
     */
    static void drawFlush3DBorder(Graphics g, int x, int y, int w, int h) {
        g.translate(x, y);
        g.setColor(MetalLookAndFeel.getControlDarkShadow());
        g.drawRect(0, 0, w - 2, h - 2);
        g.setColor(MetalLookAndFeel.getControlHighlight());
        g.drawRect(1, 1, w - 2, h - 2);
        g.setColor(MetalLookAndFeel.getControl());
        g.drawLine(0, h - 1, 1, h - 2);
        g.drawLine(w - 1, 0, w - 2, 1);
        g.translate(-x, -y);
    }
}

Related

  1. drawFlush3DBorder(Graphics g, Rectangle r)
  2. drawPressed3DBorder(Graphics g, int x, int y, int w, int h)
  3. drawPressed3DBorder(Graphics g, int x, int y, int w, int h)
  4. drawPressed3DBorder(Graphics g, int x, int y, int w, int h)