Incrementing/Decrementing using JPanel and JButton
I have been trying to solve this for quite some time now and I can't figure out what am I doing wrong here Here is the code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class PushCounterPanelMath extends JPanel { private int count; private JButton inc; private JButton dec; private JLabel label; public PushCounterPanelMath() { count = 0; inc = new JButton("Increment"); dec = new JButton("Decrement"); label = new JLabel(); inc.addActionListener(new ButtonListener()); dec.addActionListener(new ButtonListener()); add(inc); add(dec); add(label); setBackground(Color.cyan
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.