package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public final class MainPanel extends JPanel {
    private MainPanel() {
        super(new BorderLayout());

        final JProgressBar progressBar = new JProgressBar();
        progressBar.setIndeterminate(true);
        JPanel p = new JPanel(new GridBagLayout());
        p.add(progressBar);

        int cycleTime = UIManager.getInt("ProgressBar.cycleTime");
        final JSpinner cycleTimeSpinner = new JSpinner(new SpinnerNumberModel(cycleTime, 1000, 10000, 100));

        int repaintInterval = UIManager.getInt("ProgressBar.repaintInterval");
        final JSpinner repaintIntervalSpinner = new JSpinner(new SpinnerNumberModel(repaintInterval, 10, 100, 10));

        Box box = Box.createHorizontalBox();
        box.add(Box.createHorizontalGlue());
        box.add(new JButton(new AbstractAction("UIManager.put") {
            @Override public void actionPerformed(ActionEvent e) {
                progressBar.setIndeterminate(false);
                UIManager.put("ProgressBar.repaintInterval", (Integer) repaintIntervalSpinner.getValue());
                UIManager.put("ProgressBar.cycleTime", (Integer) cycleTimeSpinner.getValue());
                progressBar.setIndeterminate(true);
            }
        }));

        JPanel sp = new JPanel(new GridLayout(3, 2, 5, 5));
        sp.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        sp.add(new JLabel("ProgressBar.cycleTime:", SwingConstants.RIGHT));
        sp.add(cycleTimeSpinner);
        sp.add(new JLabel("ProgressBar.repaintInterval:", SwingConstants.RIGHT));
        sp.add(repaintIntervalSpinner);
        sp.add(Box.createHorizontalStrut(5));
        sp.add(box);

        add(sp, BorderLayout.NORTH);
        add(p);
        //add(box, BorderLayout.SOUTH);
        setPreferredSize(new Dimension(320, 240));
    }
    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 (ClassNotFoundException | InstantiationException
               | IllegalAccessException | UnsupportedLookAndFeelException ex) {
            ex.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);
    }
}

@@ -273,22 +273,16 @@
         
-final 
 JProgres
@@ -512,38 +512,32 @@
 Time%22);%0A        
-final 
 JSpinner cycleTi
@@ -703,22 +703,16 @@
         
-final 
 JSpinner
@@ -818,134 +818,34 @@
     
-Box box = Box.createHorizontalBox();%0A        box.add(Box.createHorizontalGlue());%0A        box.add(new JButton(new AbstractActi
+JButton button = new JButt
 on(%22
@@ -859,18 +859,17 @@
 er.put%22)
- %7B
+;
 %0A       
@@ -873,71 +873,40 @@
     
-    @Override public void actionPerformed(ActionEvent e) %7B%0A    
+button.addActionListener(e -%3E %7B%0A
     
@@ -954,36 +954,32 @@
 e);%0A            
-   
- 
 UIManager.put(%22P
@@ -1045,36 +1045,32 @@
 er.getValue());%0A
-    
             UIMa
@@ -1148,36 +1148,32 @@
 ));%0A            
-    
 progressBar.setI
@@ -1200,32 +1200,133 @@
         
-    %7D%0A        %7D)
+%7D);%0A%0A        Box box = Box.createHorizontalBox();%0A        box.add(Box.createHorizontalGlue());%0A        box.add(button
 );%0A%0A    

use a lambda expression instead of an anonymous class(ActionListener)