import java.awt.*; public class Engraved { public static void draw3DLine(Graphics g,int x,int y,int x1,int y1,boolean raised) { Color c1, c2; if(raised) { c1 = Color.white; c2 = Color.gray; } else { c1 = Color.gray; c2 = Color.white;} g.setColor(c1); g.drawLine(x-1, y-1, x1-1, y1-1); g.setColor(c2); g.drawLine(x+1, y+1, x1+1, y1+1); g.setColor(Color.black); g.drawLine(x, y, x1, y1); } public static void draw3DString(Graphics g,String s,int x,int y,boolean raised) { Color c1, c2; if(raised) { c1 = Color.white; c2 = Color.gray; } else { c1 = Color.gray; c2 = Color.white;} g.setColor(c1); g.drawString(s, x-1, y-1); g.setColor(c2); g.drawString(s, x+1, y+1); g.setColor(Color.black); g.drawString(s, x, y); } public static void draw3DRect(Graphics g, int x, int y, int w, int h, boolean raised) { Color c1, c2; if(raised) { c1 = Color.white; c2 = Color.gray; } else { c1 = Color.gray; c2 = Color.white;} g.setColor(c1); g.drawRect(x-1, y-1, w, h); g.setColor(c2); g.drawRect(x+1, y+1, w, h); g.setColor(Color.black); g.drawRect(x, y, w, h); } }