Jump to content
  • Advertisement
Sign in to follow this  
BlackReign

[java] Computer Freezes After Testing Applets

This topic is 4470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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>

Share this post


Link to post
Share on other sites
Interestingly, my Firefox also freezes up if I've seen anything Java and close it. No clue why, though.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!