Example of the code I have so far:
int counter = 0;
JButton click = new JButton("Click");
JLabel count = new JLabel("Score: " + counter);
count.add(click);
click.addActionListener(this);
if(e.getSource() instanceof JButton)
{
if(e.getActionCommand().equals("Click"))
{
counter++;
count.setText("Score: " + counter);
}
}
Any help would be appreciated!

New Topic/Question
Reply




MultiQuote








|