title: Create an odometer
body: <p>I tried to write a program here that adds one every time you click on the Step button. The problem I'm having is that every time i click Step, the digit is not incrementing at all. I think I'm supposed to put something in the actionListener block but I do not know what. Please help me...
  If you think something is not clear, I'll clear it up really fast!</p>
  
  <p>Panel</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class Odometer extends JPanel{
     private JLabel label, label2, label3;
     private int counter;
     public Odometer()
     {
        setLayout(new FlowLayout());
  
        JButton button = new JButton("Step");
        button.addActionListener(new Listener());
        add(button);
  
        this.setBackground(Color.black);
  
        label = new JLabel("0");
        label.setFont(new Font("serif", Font.BOLD, 50));
        label.setForeground(Color.white);
        label.setBackground(Color.black);
        label.setOpaque(true);
        add(label);
  
        label2 = new JLabel("0");
        label2.setFont(new Font("serif", Font.BOLD, 50));
        label2.setForeground(Color.white);
        label2.setBackground(Color.black);
        label2.setOpaque(true);
        add(label2);
  
        label3 = new JLabel("0");
        label3.setFont(new Font("serif", Font.BOLD, 50));
        label3.setBackground(Color.white);
        label3.setForeground(Color.black);
        label3.setOpaque(true);
        add(label3);
  
        int counter = 0;
     }
  
  
     private class Listener implements ActionListener{
        public void actionPerformed(ActionEvent e){
  
  
        }
  
     }
  
  
     public void update()
     {
        counter = Integer.parseInt(label3.getText());
        if(counter &lt; 9){
           counter++;
           label3.setText(" " + counter);
  
        }
  
        else{
           counter = 0;
           label3.setText(" " + counter);
           counter = Integer.parseInt(label2.getText());
           if(counter &lt; 9){
              counter++;
              label2.setText(" " + counter);
  
           }
           else{
              counter = 0;
              label2.setText(" " + counter);
              counter = Integer.parseInt(label.getText());
           }
           if(counter&lt;9){
              counter++;
              label.setText(" " + counter);
           }
           else{
              counter = 0;
              label.setText("0");
           }
        }
     }
  }
  </code></pre>
  
  <p>Driver</p>
  
  <pre><code>import javax.swing.JFrame;
     public class Driver04
     {
        public static void main(String[] args)
        {
           JFrame frame = new JFrame("Odometer");
           frame.setSize(400, 400);
           frame.setLocation(200, 100);
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           frame.setContentPane(new Odometer());
           frame.setVisible(true);
        }
     }
  </code></pre>
  
  
  
  <p>`</p>