package example;
//-*- mode:java; encoding:utf8n; coding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;
import com.sun.java.swing.plaf.windows.WindowsSpinnerUI;

public class MainPanel extends JPanel{
    private final JSpinner spinner1 = new JSpinner(new SpinnerNumberModel(10, 0, 1000, 1));
    private final JSpinner spinner2 = new JSpinner(new SpinnerNumberModel(10, 0, 1000, 1));
    private final JSpinner spinner3 = new JSpinner(new SpinnerNumberModel(10, 0, 1000, 1));

    public MainPanel() {
        super(new BorderLayout());

        spinner1.setUI(new MySpinnerUI());
        searchSpinnerButtons(spinner2);
        if(spinner3.getUI() instanceof WindowsSpinnerUI) {
            spinner3.setUI(new MyWinSpinnerUI());
        }else{
            searchSpinnerButtons(spinner3);
        }

        Box box = Box.createVerticalBox();
        box.add(makePanel("BasicSpinnerUI",   spinner1));
        box.add(makePanel("getName()",        spinner2));
        box.add(makePanel("WindowsSpinnerUI", spinner3));

        add(box, BorderLayout.NORTH);
        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        setPreferredSize(new Dimension(320, 200));
    }
    private static void searchSpinnerButtons(Container comp) {
        for(Component c: comp.getComponents()) {
            //System.out.println(c.getName());
            if("Spinner.nextButton".equals(c.getName())) {
                ((JButton)c).setToolTipText("getName: next next");
            }else if("Spinner.previousButton".equals(c.getName())) {
                ((JButton)c).setToolTipText("getName: prev prev");
            }else if(c instanceof Container) {
                searchSpinnerButtons((Container)c);
            }
        }
    }

    private static class MySpinnerUI extends BasicSpinnerUI {
        public MySpinnerUI() {
            super();
        }
        protected Component createNextButton() {
            JComponent nextButton = (JComponent)super.createNextButton();
            nextButton.setToolTipText("SpinnerUI: next next");
            //nextButton.setBackground(Color.GREEN);
            return nextButton;
        }
        protected Component createPreviousButton() {
            JComponent previousButton = (JComponent)super.createPreviousButton();
            previousButton.setToolTipText("SpinnerUI: prev prev");
            //previousButton.setBackground(Color.RED);
            return previousButton;
        }
    }
    private static class MyWinSpinnerUI extends WindowsSpinnerUI {
        public MyWinSpinnerUI() {
            super();
        }
        protected Component createNextButton() {
            JComponent nextButton = (JComponent)super.createNextButton();
            nextButton.setToolTipText("WindowsSpinnerUI: next next");
            return nextButton;
        }
        protected Component createPreviousButton() {
            JComponent previousButton = (JComponent)super.createPreviousButton();
            previousButton.setToolTipText("WindowsSpinnerUI: prev prev");
            return previousButton;
        }
    }
    private static JPanel makePanel(String title, JComponent c) {
        JPanel p = new JPanel(new BorderLayout());
        p.setBorder(BorderFactory.createTitledBorder(title));
        p.add(c);
        return p;
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e) {
            e.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

@@ -1113,25 +1113,24 @@
 spinner3));%0A
-%0A
         add(
@@ -1898,69 +1898,17 @@
     
-public MySpinnerUI() %7B%0A            super();%0A        %7D%0A       
+@Override
  pro
@@ -2176,32 +2176,42 @@
       %7D%0A        
+@Override 
 protected Compon
@@ -2573,72 +2573,17 @@
     
-public MyWinSpinnerUI() %7B%0A            super();%0A        %7D%0A       
+@Override
  pro
@@ -2805,24 +2805,24 @@
       %7D%0A
-
         
 protecte
@@ -2813,16 +2813,26 @@
         
+@Override 
 protecte

Add @Override annotation to createNextButton methods that implement BasicSpinnerUI