G
Guest
I want my applet to load an Imageevery 20 secs from an URL and display in a Panel.
My problem is that:
My applet loads my image but I must minimize and maximize the browser to view my image
What I can do? (Before ask, I use all of the commented lines)
My 'TimerTask' class is this:
------------------------------------------
class LoadAdv extends TimerTask {
public void run() {
try{
URL urlAdv = new URL("http://localhost/ads/adv.php?" + timeblock);
/*is class h*/ iAdv.a9 = getImage(urlAdv);
//pAdv.repaint(); // pAdv is Label
//repaint();
update(getGraphics());
}catch(Exception e){
}
timeblock++; // is int
}
}
-----class h------------------------------
public class h extends Canvas
{
public h(Image image) {a9 = image; }
public final void update(Graphics g) {paint(g);}
public final void paint(Graphics g) {g.drawImage(a9, 0, 0, this);}
public Image a9;
}
My problem is that:
My applet loads my image but I must minimize and maximize the browser to view my image
What I can do? (Before ask, I use all of the commented lines)
My 'TimerTask' class is this:
------------------------------------------
class LoadAdv extends TimerTask {
public void run() {
try{
URL urlAdv = new URL("http://localhost/ads/adv.php?" + timeblock);
/*is class h*/ iAdv.a9 = getImage(urlAdv);
//pAdv.repaint(); // pAdv is Label
//repaint();
update(getGraphics());
}catch(Exception e){
}
timeblock++; // is int
}
}
-----class h------------------------------
public class h extends Canvas
{
public h(Image image) {a9 = image; }
public final void update(Graphics g) {paint(g);}
public final void paint(Graphics g) {g.drawImage(a9, 0, 0, this);}
public Image a9;
}