Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BeatBox;
- import javax.swing.*;
- import java.awt.event.*;
- public class SimpleGui1B implements ActionListener {
- JButton button;
- public static void main(String[] args) {
- SimpleGui1B gui = new SimpleGui1B();
- gui.go();
- }
- public void go() {
- JFrame frame = new JFrame();
- JButton button = new JButton("Click me!");
- button.addActionListener(this);
- frame.getContentPane().add(button);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(300, 300);
- frame.setVisible(true);
- }
- public void actionPerformed(ActionEvent event) {
- button.setText("Hui sasi!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement