1 7 8 package com.sun.java.swing.plaf.windows; 9 10 import java.awt.*; 11 import java.awt.event.*; 12 13 import javax.swing.plaf.basic.*; 14 import javax.swing.plaf.*; 15 import javax.swing.*; 16 17 import com.sun.java.swing.plaf.windows.TMSchema.Part; 18 19 20 21 public class WindowsSpinnerUI extends BasicSpinnerUI { 22 public static ComponentUI createUI(JComponent c) { 23 return new WindowsSpinnerUI(); 24 } 25 26 protected Component createPreviousButton() { 27 if (XPStyle.getXP() != null) { 28 JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_SPINDOWN); 29 xpButton.setRequestFocusEnabled(false); 30 installPreviousButtonListeners(xpButton); 31 return xpButton; 32 } 33 return super.createPreviousButton(); 34 } 35 36 protected Component createNextButton() { 37 if (XPStyle.getXP() != null) { 38 JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_SPINUP); 39 xpButton.setRequestFocusEnabled(false); 40 installNextButtonListeners(xpButton); 41 return xpButton; 42 } 43 return super.createNextButton(); 44 } 45 46 private UIResource getUIResource(Object [] listeners) { 47 for (int counter = 0; counter < listeners.length; counter++) { 48 if (listeners[counter] instanceof UIResource) { 49 return (UIResource)listeners[counter]; 50 } 51 } 52 return null; 53 } 54 } 55 56 | Popular Tags |