Results 1 to 5 of 5
Thread: Appletviewer
- 09-20-2012, 08:07 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Appletviewer
I am having some troubles getting the applet viewer to open my first ever attempt. The viewer opens but my file does not open with it.
Here is the code I am using from the textbook:
import java.awt.*;
import java.applet.*;
/*
<applet code ="SimpleApplet" width=200 height=60>
</applet>
*/
public class SimpleApplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
I have the directory of the file opened up in command prompt and that is just a notebook file. I typed in appletviewer RunApp.html(name of the file in the directory) and the appletviewer opens but has an error opening my file. The error says "Can't read AppletViewer properties file" then lists a directory. It also has a ClassNotFoundException: SimpleApplet which quite obviously means SimpleApplet was not found when trying to load. Any help would be fantastic, thanks ahead of time.
- 09-20-2012, 11:15 AM #2
Re: Appletviewer
Forum Rules
Guide For New Members
BB Code List - Java Programming Forum
Have you compiled the class? Your statementseems to imply that you have written Java code in a file with a .html extension. Better go through the Tutorial Lesson: Java Applets (The Java™ Tutorials > Deployment)I typed in appletviewer RunApp.html(name of the file in the directory)
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 09-20-2012, 11:56 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Appletviewer
appletviewer takes an html document generally and displays any APPLET/OBJECT/whatever-the-other-one-is tags.
BiCure, as Darryl asks, though, have you compiled the SimpleApplet class.
If so, is the resulting class file in the same directory as the html file you are opening?
Finally, if you get an error running something it is best to provide the full error message (plus any stack traces) here.Please do not ask for code as refusal often offends.
- 09-20-2012, 12:53 PM #4
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Appletviewer
Thanks for the help, that was definitely my problem. Been a few months since I've done any Java but picking up where I left off from then put my next subject as applets. I did not know I had to compile the SimpleApplet class to run the appletviewer as I've never used it before. Thanks again, I'm sure I'll have more questions in the future as I'm trying to pound out a chapter every week day in this book.
- 09-20-2012, 12:54 PM #5
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Similar Threads
-
[Applet] All right in AppletViewer but error in browser
By a_butta in forum New To JavaReplies: 3Last Post: 06-12-2011, 06:07 PM -
Applet with Signed JAR throws AccessControlException in AppletViewer
By Technolithic in forum Java AppletsReplies: 1Last Post: 07-27-2009, 11:59 AM -
Problem with applet, between appletviewer and browser
By Goodwine in forum Java AppletsReplies: 0Last Post: 11-30-2008, 03:09 AM -
Difference between browswer and appletviewer?
By jklsemicolon in forum Java AppletsReplies: 5Last Post: 08-09-2008, 05:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks