setLocaiton问题
import java.awt.*;
import javax.swing.*;
public class Ttest extends JApplet {
JLabel lb;
Container c;
JPanel p;
JTextField txt_word;
public Ttest()
{
c=this.getContentPane();
JLabel lb=new JLabel("AAA");
lb.setLocation(40,80);
c.add(lb);
}
}
为什么setLocation不起作用,郁闷!