home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / plaf / metal / MetalCheckBoxUI.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  1.2 KB  |  32 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import com.sun.java.swing.JComponent;
  5. import com.sun.java.swing.UIManager;
  6. import com.sun.java.swing.plaf.ComponentUI;
  7. import com.sun.java.swing.plaf.ToggleButtonUI;
  8. import java.awt.Dimension;
  9. import java.awt.Graphics;
  10. import java.awt.Rectangle;
  11.  
  12. public class MetalCheckBoxUI extends MetalRadioButtonUI {
  13.    protected static ToggleButtonUI checkboxUI;
  14.  
  15.    public static ComponentUI createUI(JComponent var0) {
  16.       if (checkboxUI == null) {
  17.          checkboxUI = new MetalCheckBoxUI();
  18.       }
  19.  
  20.       return checkboxUI;
  21.    }
  22.  
  23.    public Icon createIcon() {
  24.       return UIManager.getIcon("CheckBox.icon");
  25.    }
  26.  
  27.    protected void paintFocus(Graphics var1, Rectangle var2, Dimension var3) {
  28.       var1.setColor(UIManager.getColor("CheckBox.focus"));
  29.       var1.drawRect(var2.x, var2.y - 1, var2.width + 1, var2.height + 1);
  30.    }
  31. }
  32.