Solved

applet doesnt start until click(IE4.0)

Posted on 1998-06-22
5
226 Views
Last Modified: 2010-03-30
Why any applet doesnt start in IE4.0 (NT4.0), until I click in the applet area. In netscape all its ok. In the Init method of the applet I call requestFocus() and repaint.
Thanks.
0
Comment
Question by:wau
5 Comments
 
LVL 1

Expert Comment

by:ragnar
ID: 1223511
maybe you should show the source here, or give a link to the applet.
0
 

Author Comment

by:wau
ID: 1223512
ok. the link of my applet is http://members.xoom.com/lakes/Ilustr.html
but
public class Thing extends Applet
{
 public void init()
 {
  requestFocus();
  repaint();
 }
 public void paint(Graphics g)
 {
  g.drawString("I wont appear until click",10,10);
 }
}
wont display anything until I click in the applet area. This only happens in IE4.0(NT), not in Netscape(Mac/PC) and in IE3.0(Mac).
Why?
0
 
LVL 2

Accepted Solution

by:
aziz061097 earned 50 total points
ID: 1223513
I have a NT 4.0 and IE 4.0 . I ran the above applet and it worked perfectly fine. I did not have to click in the applet to get it working. repaint() tells the system that the applet needs to be redrawn. The browser responds by invoking the paint method of the applet the next time it has a moment , which is usually right away (but necessarily) . This means that if the browser is busy doing something else the paint method call could be delayed.
0
 

Expert Comment

by:cyrille
ID: 1223514
I had the same problem. repaint() doesn't seem to call the update function in IE4 (don't ask me why). However, I solved my problem by forcing the call to update().

Here's the protion of code I used:

init()
{
appletImg = createImage(maxWidth, maxHeight);
appletG = appletImg.getGraphics();
this.repaint();
update(appletG);
}
public void update(Graphics g)
{
paint(g);
}


0
 

Author Comment

by:wau
ID: 1223515
My applet seems to run well, when I update to Internet Explorer 4.x
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question