1 22 23 package org.gjt.sp.jedit.textarea; 24 25 import java.awt.*; 26 import javax.swing.border.AbstractBorder ; 27 import javax.swing.plaf.metal.MetalLookAndFeel ; 28 29 public class TextAreaBorder extends AbstractBorder 30 { 31 public void paintBorder(Component c, Graphics g, int x, int y, 33 int width, int height) 34 { 35 g.translate(x,y); 36 37 g.setColor(MetalLookAndFeel.getControlDarkShadow()); 38 g.drawRect(0,0,width-2,height-2); 39 40 g.setColor(MetalLookAndFeel.getControlHighlight()); 41 g.drawLine(width-1,1,width-1,height-1); 42 g.drawLine(1,height-1,width-1,height-1); 43 44 g.setColor(MetalLookAndFeel.getControl()); 45 g.drawLine(width-2,2,width-2,2); 46 g.drawLine(1,height-2,1,height-2); 47 48 g.translate(-x,-y); 49 } 51 public Insets getBorderInsets(Component c) 53 { 54 return new Insets(1,1,2,2); 55 } } 57 | Popular Tags |