How to use .getSource() with multiple JButtons in ActionListener
<p>Basically an object with a few ints. I want the ints to change when their respective button is pressed. For example if you press JButton 2 then the second int should change based on the method within it's if statement in the actionPerformed method. Not sure what I did wrong but the buttons do absolutely nothing right now.</p>

<pre><code>public class Object {

    public int someInt;
    //public int someOtherInt;
    //etc. I have a few different ints that I do the same thing with throughout the code, each JButton changes a different int

    public Object() {

        this.someInt = someInt;

        JFrame frame = new JFrame();
        frame.setLayout(new FlowLayout());
        frame.setDefaultCloseOperation(3);
        frame.setSize(325, 180);
        frame.setVisible(true);
        frame.setTitle("Title");

        //String message = blah blah
        JLabel confirmMessage = new JLabel(message);
        JButton button1 = new JButton("1");
        JButton button2 = new JButton("2");
        JButton button3 = new JButton("3");

        //creating action listener and adding it to buttons and adding buttons to frame

    }

    public class listen implements ActionListener {

        private int someInt;
        private int someOtherInt;

        public listen(int someInt, int someOtherInt) {

            this.someInt = someInt;
            this.someOtherInt = someOtherInt;
        }

        public void actionPerformed() {
            if (aE.getSource() == button1) {
                //change someInt
            }
            //same thing for other buttons
        }
    }
}
</code></pre>