import java.awt.*;
import javax.swing.*;
public class JFrameDemo extends Frame
{
public static void main(String[] args)
{
JFrameDemo frame = new JFrameDemo ("My Frame");
frame.setSize(200,200);
frame.setBackground(Color.red);
frame.setLayout(null);
frame.setVisible(true);
Panel panel = new Panel();
panel.setSize(100, 100);
panel.setBackground(Color.yellow);
frame.add(panel);
//frame.show();
}
public JFrameDemo (String str)
{
super(str);
}
}
评论