Opoe

Untitled

Mar 26th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import javax.swing.JButton;
  2. import javax.swing.JFrame;
  3. import javax.swing.JPanel;
  4. import javax.swing.JOptionPane;
  5.  
  6.  
  7.  
  8. public class myTest{
  9.  
  10. public static void main(String[] args){
  11.  
  12. JPanel panel = new JPanel();
  13.  
  14. JButton button1 = new JButton();
  15.  
  16. panel.add(button1);
  17.  
  18. button1.addActionListener(new ActionListener() {
  19.  
  20. public void actionPerformed(ActionEvent arg0) {
  21. JOptionPane.showMessageDialog(null, "Hello World");
  22.  
  23. }
  24. });
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment