1
我使用setLocation(x,y)將組件放置在基於AWT的小程序中,但是當切換選項卡時,組件的位置會回到其默認佈局。Applet組件在切換選項卡後轉到默認佈局
import java.applet.*;
import java.awt.*;
public class AppletEx extends Applet {
Label test;
public void init() {
test = new Label("test");
add(test);
}
public void start() {
}
public void stop() {
}
public void destroy() {
}
public void paint() {
test.setLocation(10, 10);
}
}