1 7 8 package javax.swing.plaf.basic; 9 10 import java.awt.*; 11 import javax.swing.*; 12 import javax.swing.border.*; 13 import javax.swing.plaf.*; 14 import java.awt.*; 15 import java.awt.event.*; 16 17 18 24 public class BasicViewportUI extends ViewportUI { 25 26 private static ViewportUI viewportUI; 28 29 public static ComponentUI createUI(JComponent c) { 30 if(viewportUI == null) { 31 viewportUI = new BasicViewportUI (); 32 } 33 return viewportUI; 34 } 35 36 public void installUI(JComponent c) { 37 super.installUI(c); 38 installDefaults(c); 39 } 40 41 public void uninstallUI(JComponent c) { 42 super.uninstallUI(c); 43 44 } 45 46 protected void installDefaults(JComponent c) { 47 LookAndFeel.installColorsAndFont(c, 48 "Viewport.background", 49 "Viewport.foreground", 50 "Viewport.font"); 51 LookAndFeel.installProperty(c, "opaque", Boolean.TRUE); 52 } 53 54 protected void uninstallDefaults(JComponent c) { 55 } 56 } 57 | Popular Tags |