This code takes about 8 seconds (Java 1.4):
1 2 3 4 5
| canvas = new Canvas(); canvas.setBackground(new Color(0, 0, 0)); canvas.setBounds(0, 0, 640, 480); applet.add("Center", canvas); |
This code takes <1 sec:
1 2 3 4 5
| canvas = new Canvas(); canvas.setBackground(new Color(0, 0, 0)); canvas.setBounds(0, 0, 640, 480); applet.add("Center", canvas); |
Bizarre...
Yeah; what's the difference, exactly?
Anyway, I have an outstanding bug on loading and starting of applets in 1.4.x where sometimes applets can crash on startup - and never get to display anything - under linux. I narrowed it down to a race condition somewhere in Sun's code. It's been accepted but not yet fixed. Who knows how much more screwed code there is in applet startup ?
