The Artima Developer Community
Sponsored Link

Java Answers Forum
trouble with JApplet

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Gibran Shah

Posts: 27
Nickname: gibby
Registered: Jun, 2004

trouble with JApplet Posted: Jun 8, 2010 2:45 PM
Reply to this message Reply
Advertisement
Hello,

I'm new to Java applets, and I'm practicing with this one here:

http://www.dgp.toronto.edu/~mjmcguff/learn/java/06-threads/

Eventually, I would like to program a simple video game, one that will be using swing GUIs, and I'm told that for such applications, one should really use JApplets (which requires importing javax.swing.JApplet).

So I made one simple modification to the code at the above link. I imported javax.swing.JApplet in addition to the libraries already imported, and I made the Thread1 class an extension of the JApplet class instead of the Applet class.

This seems to have changed something though. If you go to my website:

http://www.shahspace.com

you'll see that the lines that have been drawn are not being erased as it moves to the right. It's almost as though the repaint() function works differently with JApplets than it does Applets.

Any insight as to why this might be happening and how to fix it?

Topic: Insert one DefaultStyledDocument into another DefaultStyledDocument Previous Topic   Next Topic Topic: Doubt in Socket Programming

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use