Solved

applet doesnt start until click(IE4.0)

Posted on 1998-06-22
5
221 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now