1 18 package org.apache.batik.util.gui.resource; 19 20 import java.awt.Color ; 21 import java.awt.Dimension ; 22 import java.awt.Graphics ; 23 24 import javax.swing.JComponent ; 25 26 32 public class JToolbarSeparator extends JComponent { 33 36 public JToolbarSeparator() { 37 setMaximumSize(new Dimension (15, Integer.MAX_VALUE)); 38 } 39 40 protected void paintComponent(Graphics g) { 41 super.paintComponent(g); 42 43 Dimension size = getSize(); 44 int pos = size.width / 2; 45 g.setColor(Color.gray); 46 g.drawLine(pos, 3, pos, size.height - 5); 47 g.drawLine(pos, 2, pos + 1, 2); 48 g.setColor(Color.white); 49 g.drawLine(pos + 1, 3, pos + 1, size.height - 5); 50 g.drawLine(pos, size.height - 4, pos + 1, size.height - 4); 51 } 52 } 53 | Popular Tags |