Sign in to follow this  
BlackReign

[java] Computer Freezes After Testing Applets

Recommended Posts

BlackReign    220
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
BlackReign    220
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
Funkapotamus    189
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
Son of Cain    480
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
BlackReign    220
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   
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this