0

I'm going to finish writing a java applet, which uses swing.

I deployed it to my website, but after the applet finishes loading (The cup of coffee), the applet shows blank white screen for 23 more seconds.

The applet is deployed here: http://www.nispahit.com/applet-2

I read it could be an init problem (that init() of the applet takes a long time). So, I removed everything from init() :

@Override
public void init(){     
    JOptionPane.showMessageDialog(this, "hello");
}

Unfortunately it didn't help. Does someone have an idea as to why it takes 23 more seconds to applet to load with this white screen after loading the cup of coffee? (The blank screen will make users think there is a problem...)

A possible solution can be showing the users a message they have to wait instead the white screen - but I don't know how can I do even that...

Any ideas?

Thanks.

Edit: 2 more things:

  1. When I execute it locally from an html file on my computer, it works just fine (no white screen.
  2. I use 2 jar files (because I have to use log4j). I tried switching their order in the html file - didn't help. Maybe the problem is somehow related to it?
user1028741
  • 2,745
  • 6
  • 34
  • 68

1 Answers1

0

The problem was that in the JApplet class, I had a member of the type Logger (initialized there).

Apperantly the members (and static members) of the applet are initializing before the applet is shown (it's reasonable). The Logger initialization was very long, and that's why I had the white screen.

If someone run to the same problem, I would check the members of the classes, try to initialize them in the init() method instead on the declaration line.

user1028741
  • 2,745
  • 6
  • 34
  • 68