1 7 8 package javax.swing.plaf.metal; 9 10 import javax.swing.*; 11 import java.awt.Color ; 12 import java.awt.Dimension ; 13 import java.awt.Graphics ; 14 import java.awt.Insets ; 15 import java.awt.Rectangle ; 16 import javax.swing.plaf.*; 17 18 19 26 27 public class MetalPopupMenuSeparatorUI extends MetalSeparatorUI 28 { 29 public static ComponentUI createUI( JComponent c ) 30 { 31 return new MetalPopupMenuSeparatorUI (); 32 } 33 34 public void paint( Graphics g, JComponent c ) 35 { 36 Dimension s = c.getSize(); 37 38 g.setColor( c.getForeground() ); 39 g.drawLine( 0, 1, s.width, 1 ); 40 41 g.setColor( c.getBackground() ); 42 g.drawLine( 0, 2, s.width, 2 ); 43 g.drawLine( 0, 0, 0, 0 ); 44 g.drawLine( 0, 3, 0, 3 ); 45 } 46 47 public Dimension getPreferredSize( JComponent c ) 48 { 49 return new Dimension ( 0, 4 ); 50 } 51 } 52 53 54 55 56 | Popular Tags |