这个问题在于 在Frame中添加组件时,每个组件先设定了位置,但是添加到Frame中后始终会出现问题。
例如:
class MyGame extends Frame
{
MyGame()
{
Label c[] = new Label[8];
for(i = 0; i<8; i++)
{
c[i] = new Label(“的");
c[i].setLocation(10,i*10+10);
this.add(c[i]);
}
this.setBounds(200,200,400,400);
this.setResizable(false);
this.setVisible(true);
}
public static void main(String args[])
{
new MyGame();
}
}
这里按说应给是会添加八个 “的” 字到窗口中 但是出来的却只有一个 而且位置也不对
应该如何解决呢? 求教啊