1 19 20 package org.netbeans.swing.plaf.gtk; 21 22 import java.awt.Color ; 23 import java.awt.Component ; 24 import java.awt.Graphics ; 25 import java.awt.Insets ; 26 import javax.swing.UIManager ; 27 import javax.swing.border.Border ; 28 29 34 public class InsetBorder implements Border { 35 private boolean left; 36 private boolean right; 37 38 39 public InsetBorder(boolean left, boolean right) { 40 this.left = left; 41 this.right = right; 42 } 43 44 public java.awt.Insets getBorderInsets(java.awt.Component c) { 45 return new Insets (2, left ? 6 : 2, 0, right ? 6 : 2); 46 } 47 48 public boolean isBorderOpaque() { 49 return false; 50 } 51 52 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { 53 int h = c.getHeight(); 54 Color col = g.getColor(); 55 g.setColor (UIManager.getColor("controlShadow")); if (left) { 57 g.drawLine (x + 3, y, x + 3, y + h - 1); 58 } 59 if (right) { 60 g.drawLine (x + width - 3, y, x + width - 3, y + h - 1); 61 } 62 g.drawLine (x, y, x + width - 1, y); 63 } 64 65 } 66 | Popular Tags |