アットウィキロゴ

java0601p

import java.awt.*;
import java.awt.event.*;

class game0601 extends Frame {
public static void main(String[] args) {
game0601 frame = new game0601();
}
  
game0601() {
setSize(500, 500);
setLayout(new FlowLayout());
Button button = new Button("click!");
button.addActionListener(new baction());
add(button);
setVisible(true);
               addWindowListener(new stopwin());
}

class stopwin extends WindowAdapter{
   public void windowClosing(WindowEvent we){System.exit(0);}
   }

class baction implements ActionListener {
public void actionPerformed(ActionEvent e) {
System.out.println("hhhhhh");
}
}
}
最終更新:2011年02月25日 07:14