Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.JOptionPane;
- public class myTest{
- public static void main(String[] args){
- JPanel panel = new JPanel();
- JButton button1 = new JButton();
- panel.add(button1);
- button1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- JOptionPane.showMessageDialog(null, "Hello World");
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment