Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

applet doesnt start until click(IE4.0)

Posted on 1998-06-22
5
Medium Priority
?
241 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 100 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

971 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