J'ai une applet Java (JApplet). Cette applet utilise un composant JComponent (PanelAux) pour afficher les valeurs et les images qui changent périodiquement. Mais l'applet ne se rafraîchit pas. Que puis-je faire pour rafraîchir mon applet?Problèmes d'actualisation Java Applet
//--------------------------------------------RUN
public void run()
while (true) {
try {
myThread.sleep(1000);
}
catch (InterruptedException e){
}
repaint();
}
}
//--------------------------------------------PAINT
public void paint(Graphics g)
{
dim = new Dimension(image.getWidth(this)+50,image.getHeight(this)+50);
this.resize(dim);
this.setMaximumSize(dim);
this.setMinimumSize(dim);
PanelAux panel = new PanelAux(image); //JComponent
add(panel);
super.paint(g);
}
Merci
Ou redimensionner et définir la taille minimale et maximale. –