javascript
I would like to program like a pro...
javascript
import java.awt.event.*;
import javax.swing.*;
public class Clicker extends JFrame implements ActionListener {
int count;
JButton button;
Clicker() {
super("Click Me");
button = new JButton(String.valueOf(count));
add(button);
button.addActionListener(this);
setSize(200,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
count++;
button.setText(String.valueOf(count));
}
public static void main(String[] args) { new Clicker(); }
}
javascript
import java.awt.event.*;
import javax.swing.*;
public class Clicker extends JFrame implements ActionListener {
int count;
JButton button;
Clicker() {
super("Click Me");
button = new JButton(String.valueOf(count));
add(button);
button.addActionListener(this);
setSize(200,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
count++;
button.setText(String.valueOf(count));
}
public static void main(String[] args) { new Clicker(); }
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us