1 7 8 package com.sun.java.swing.plaf.motif; 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 25 26 public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI 27 { 28 public static ComponentUI createUI( JComponent c ) 29 { 30 return new MotifPopupMenuSeparatorUI(); 31 } 32 33 public void paint( Graphics g, JComponent c ) 34 { 35 Dimension s = c.getSize(); 36 37 g.setColor( c.getForeground() ); 38 g.drawLine( 0, 0, s.width, 0 ); 39 40 g.setColor( c.getBackground() ); 41 g.drawLine( 0, 1, s.width, 1 ); 42 } 43 44 public Dimension getPreferredSize( JComponent c ) 45 { 46 return new Dimension ( 0, 2 ); 47 } 48 49 } 50 | Popular Tags |