import java.awt.event.*;
class pro0625 extends Frame {
public static void main(String [] args) {
Frame f=new pro0625();
f.setTitle("[[pro]]0625");
f.setSize(500,500);
f.setBackground(Color.yellow);
f.setVisible(true);
}
pro0625(){
Button bu =
new Button( "
ボタン" );
fc fcx = new fc();
fcx.setSize(300,300);
fcx.setBackground(Color.blue);
TextField te = new TextField();
add(fcx);
add(bu );
add(te );
pack();
setVisible( true );
addWindowListener(new stopwin());
}
}
class fc extends Canvas{
public void paint(Graphics g){
g.setColor(Color.red);
g.drawLine(
100,100,250,250);
}
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
最終更新:2010年09月17日 21:24