Hallo,
warum wird die Methode update() von Der Mathode repaint() manchmal nicht aufgerufen?
Bei mir ist JRE-Version 1.5.0_02 installiert, kann es daran liegen?
so sieht meine Programm aus, was mache ich falsch?
private void run{
currentIndex = startIndex;
boolean imageload = false;
try {
while ( noStopRequested ) {
if( imageload == true ) {
tracker.removeImage(myImage);
myImage.flush();
myImage = null;
}
try
{
myImage = ImageIO.read(new URL(urlString));
}
catch (IOException ae)
{
System.out.println(ae.toString());
}
tracker.addImage(myImage, 0);
tracker.waitForAll();
imageload = true;
repaint();
Thread.sleep( sleepTime );
}
} catch ( InterruptedException x ) {
Thread.currentThread().interrupt();
}
}
public void paint(Graphics g) {
raster(g); // zeichnen eines rasters
koordinatenSystem(g); //zeichnen der achsen
beschriftung(g); //einfuegen der achsen beschriftung
Font font;
font = new Font(„Arial“,Font.PLAIN,30);
g.setFont(font);
g.drawString(„Live image“,titleIndex, 35);
if( myImage != null ) {
g.drawImage(myImage, calcPosX(xMin)+4, calcPosY(yMax)+4,
(int)appletWidth - 4, (int)appletHight - 4, this);//Bild
}
}
public void update(Graphics g) {
paint(g);
}
Gruss.
Hicham