所以我想做的是显示一个字符串hello world“(”Hello World“,i * 100,y)”我想显示我的jlabels在ArrayList中
public class FruitWarUI extends JApplet implements Runnable{
public int WIDTH = 500, HEIGHT = 725, y=0;
BufferedImage screen = new BufferedImage(WIDTH,HEIGHT, 4);
@Override
public void init(){
new Thread(this).start();
}
@Override
public void paint(Graphics g){
screen.getGraphics().clearRect(0, 0, WIDTH, HEIGHT);
for(int i=0; i<=5; i++) screen.getGraphics().drawString("Hello World",i*100,y);
g.drawImage(screen, 0, 0, this);
}
@Override
public void run(){
try{
for(y=0; y<700; y++){
Thread.sleep(10);
repaint();
}
run();
} catch (Exception e) {
}
}