[java] Computer Freezes After Testing Applets

Started by
12 comments, last by GameDev.net 18 years ago
Hi, when I try to test my applets in any browser, the applets run, but my computer freezes after I close the browser window. Oddly, when I run other applets on the internet they don't freeze (except some of the 1.5 programs on the Java website, which don't run at all). It's weird, because when I visit http://www.java.com/en/download/installed.jsp, it says I have the latest version of Java installed. Any ideas?
Advertisement
The problem seems to be with the code you're running. Post it out ;)
a.k.a javabeats at yahoo.ca
It's probably some stupid mistake.........

import java.applet.Applet;import java.awt.*;public class HolidayCard extends Applet {    public void paint (Graphics gr) {        gr.drawString("Merry Christmas",230,100);        gr.setColor(Color.green);    gr.drawLine(250,200,210,250);    gr.drawLine(210,250,225,250);      }}


<html><head><title> My Webpage </title></head><body bgcolor=black><body Text=red><p align=center><applet code="HolidayCard.class" width="540" height="500"></applet></p><body></html>
Interestingly, my Firefox also freezes up if I've seen anything Java and close it. No clue why, though.
¨@_
My computer also freezes after closing a Swing application, even a simple one.
Works OK on my machine!

JDK 1.5 update 6 with (shit!) Internet Explorer.

Son Of Cain
a.k.a javabeats at yahoo.ca
Works fine in both on mine.

IE - Most Recent
Firefox - 1.5.0.1
Java - 1.5.0_03 Build b07
Could it be Windows or maybe my gfx card?
I would look for error logs saved by the JVM.
I forgot to mention: Try running the applet via Java's viewer.
It's called "appletviewer.exe", located in the /bin directory in the JDK folder.
It runs fine in appletviewer for me. If you come to the same result, then I think the problem can be narrowed down to the browser.

If you don't like messing with the command line, running the applet from most IDE's will envoke appletviewer. At least, that's what Eclipse does. I can't vouch for Netbeans...

This topic is closed to new replies.

Advertisement