Mein problem ist, das die bilder total flackern (auch der htintergrund)
wie kann man das abstellen???
ich hab was gelesen mit BufferedImage aber ich weiß net wie ich das realisieren soll
danke schonmal im voraus!
wie kann man das abstellen???
ich hab was gelesen mit BufferedImage aber ich weiß net wie ich das realisieren soll
danke schonmal im voraus!
Code:
import java.awt.*;
import java.applet.*;
import java.net.*;
public class ImageExample extends Applet
{
Image smil1;
Image smil2;
Image hintergrund;
URL base;
MediaTracker mt;
public void init()
{
mt = new MediaTracker(this);
try {
base = getDocumentBase();
}
catch (Exception e) {}
smil1 = getImage(base,"sm_vacation_007_x~f.b.h_40.gif");
smil2 = getImage(base,"sm_circustent.b.my_1.h_24.gif");
hintergrund = getImage(base,"cloudsblue.gif");
mt.addImage(smil1,1);
mt.addImage(smil2,2);
mt.addImage(hintergrund,3);
try {
mt.waitForAll();
}
catch (InterruptedException e) {}
}
public void paint(Graphics g)
{
g.drawImage(hintergrund,0,0,this);
g.drawImage(smil1,20,20,this);
g.drawImage(smil2,20,100,this);
}
}