import java.awt.*;
public class TestPanel
{ public static void main(String[] args)
{ Frame fm1=new Frame("Hello");
Panel pn1=new Panel();
Panel pn2=new Panel();
Panel pn3=new Panel();
fm1.setSize(400,350);
fm1.setBackground(Color.gray);
fm1.setLayout(null);
pn1.setSize(100,100);
pn1.setBackground(Color.red);
pn1.setLocation(0,50);
pn2.setSize(100,100);
pn2.setBackground(Color.yellow);
pn2.setLocation(100,150);
pn3.setSize(100,100);
pn3.setBackground(Color.green);
pn3.setLocation(200,250);
fm1.add(pn1);
fm1.add(pn2);
fm1.add(pn3);
fm1.setVisible(true);
}
}
说是:cannot access Frame
bad cladd file:.\Frame.java
file does not contain class Frame