/**
* 画板
*
* @time 3:38:10 PM
* @author retacn yue
* @Email zhenhuayue@sina.com
*/
public class Test_FrameWithPanel extends Frame {
private static final long serialVersionUID = 1L;
private Test_FrameWithPanel(String str) {
super(str);
}
public static void main(String[] args) {
// 初始化窗口(帧)
Test_FrameWithPanel frameWithPanel = new Test_FrameWithPanel("Frame with Panel");
// 生成画板
Panel panel = new Panel();
// 设置窗体大小
frameWithPanel.setSize(400, 300);
frameWithPanel.setLayout(null);
// 设置画板的大小
panel.setSize(200, 150);
// 设置画板颜色
panel.setBackground(Color.white);
// 设置窗体背景颜色
frameWithPanel.setBackground(Color.black);
// 设置窗体布局
frameWithPanel.add(panel);
frameWithPanel.setVisible(true);
}
}
* 画板
*
* @time 3:38:10 PM
* @author retacn yue
* @Email zhenhuayue@sina.com
*/
public class Test_FrameWithPanel extends Frame {
private static final long serialVersionUID = 1L;
private Test_FrameWithPanel(String str) {
super(str);
}
public static void main(String[] args) {
// 初始化窗口(帧)
Test_FrameWithPanel frameWithPanel = new Test_FrameWithPanel("Frame with Panel");
// 生成画板
Panel panel = new Panel();
// 设置窗体大小
frameWithPanel.setSize(400, 300);
frameWithPanel.setLayout(null);
// 设置画板的大小
panel.setSize(200, 150);
// 设置画板颜色
panel.setBackground(Color.white);
// 设置窗体背景颜色
frameWithPanel.setBackground(Color.black);
// 设置窗体布局
frameWithPanel.add(panel);
frameWithPanel.setVisible(true);
}
}