• Advertisement
Sign in to follow this  

[java] Computer Freezes After Testing Applets

This topic is 4350 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
Netbeans does both (appletviewer or browser, you choose).
Can you print out the stack trace of the Java console? (you said your PC freezes only after you close the browser's window =)

Share this post


Link to post
Share on other sites
Quote:
Original post by Kevinator
I would look for error logs saved by the JVM.


Where would those be?

Quote:
Original post by Funkapotamus
I forgot to mention: Try running the applet via Java's viewer.
It's called "appletviewer.exe",


Still freezes.

Quote:
Original post by Son of Cain
Can you print out the stack trace of the Java console? (you said your PC freezes only after you close the browser's window =)


How would I do that?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi guys, i`m having the same problem, after a web search I found a bug report in Sun`s bug database and a guy in a forum saying this is a problem with antialiasing, the links are these:

Bug report:
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=2c05f5f1953fc9ffffffffa718fd151fa484a:WuuT?bug_id=4713003

Antialiasing:
http://my.opera.com/community/forums/topic.dml?id=118219

I found these today, so I didn`t test the solutions given, I`ll test when I get home from work.

Regards

Share this post


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

  • Advertisement