(JFrame.EXIT_ON_CLOSE);
frame.setBounds(100, 100, 300, 200);
frame.setVisible(true); // display the frame
/*
* because g will be null if Graphics g = container.getGraphics();
* before the display of the related component
*/
frame.paintJFrame();
}
}
作者:Gaowen_HAN