Java Utililty Methods Swing 3D Border

List of utility methods to do Swing 3D Border

Description

The list of methods to do Swing 3D Border are organized into topic(s).

Method

voiddrawFlush3DBorder(Graphics g, int x, int y, int w, int h)
This draws the "Flush 3D Border" which is used throughout the Metal L&F
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);
...
voiddrawFlush3DBorder(Graphics g, Rectangle r)
draw Flush D Border
drawFlush3DBorder(g, r.x, r.y, r.width, r.height);
voiddrawPressed3DBorder(Graphics g, int x, int y, int w, int h)
draw Pressed D Border
g.translate(x, y);
g.setColor(UIManager.getColor("controlShadow"));
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 2);
g.setColor(UIManager.getColor("controlLtHighlight"));
g.drawLine(w - 1, 0, w - 1, h - 1);
g.drawLine(0, h - 1, w - 1, h - 1);
g.translate(-x, -y);
...
voiddrawPressed3DBorder(Graphics g, int x, int y, int w, int h)
This draws a variant "Flush 3D Border" It is used for things like pressed buttons.
g.translate(x, y);
drawFlush3DBorder(g, 0, 0, w, h);
g.setColor(MetalLookAndFeel.getControlShadow());
g.drawLine(1, 1, 1, h - 2);
g.drawLine(1, 1, w - 2, 1);
g.translate(-x, -y);
voiddrawPressed3DBorder(Graphics g, int x, int y, int w, int h)
This draws a variant "Flush 3D Border" It is used for things like pressed buttons.
g.translate(x, y);
drawFlush3DBorder(g, 0, 0, w, h);
g.setColor(MetalLookAndFeel.getControlShadow());
g.drawLine(1, 1, 1, h - 2);
g.drawLine(1, 1, w - 2, 1);
g.translate(-x, -y);