日期:2014-05-20 浏览次数:20801 次
package javagui;
import java.awt.*;
public class JavaGUI extends Frame {
public JavaGUI(){
Dimension d = new Dimension(400,400);
setSize(d);
setTitle("The first GUI");
setVisible(true);
setBackground(Color.BLUE);
}
public void pain(Graphics g){
g.drawString("This is the first application", 10,40);
g.drawLine(0, 0, 11, 11);
}
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Hello world");
JavaGUI myjavagui = new JavaGUI();
}
}