public class TestGraphics extends Frame{
public static void main(String[] args) {
TestGraphics gp = new TestGraphics();
gp.setBounds(300,300,100,100);
gp.setVisible(true);
}
public static void main(String[] args) {
TestGraphics gp = new TestGraphics(); //實例化對象,創建了一個Frame
gp.setBounds(300,300,100,100); //將創建的界面在(300,300)的位置顯示,並且大小寬100,高100
gp.setVisible(true); //所創建的界面是可見的
}