import java.awt.Graphics;
import java.awt.Frame;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
public class FrameVerySimple{
public static void main(String argv[])throws Exception{
Frame frame=new Frame(){
public void paint(Graphics g){
super.paint(g);
g.setColor(Color.red);
g.setFont(Font.decode("宋体-220"));
g.drawString("欢迎", 50, 280);
g.setColor(Color.green);
g.drawOval(40, 40, 700, 350);
}
};
frame.setSize(800, 380);
frame.setVisible(true);
frame.addWindowListener(new WindowListener(){
public void windowActivated(WindowEvent e){}
public void windowClosed(WindowEvent e){}
public void windowClosing(WindowEvent e){System.exit(0);}
public void windowDeactivated(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowOpened(WindowEvent e){}
});
}
}
取消
评论