I want to add an arraylist that contains jlabels of images to my applet screen

125 Views Asked by At

So what i want to do is instead display a string hello world "("Hello World",i*100,y)" i want to display my jlabels which is in an 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) {
    } 
    }
0

There are 0 best solutions below