Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to run an applet with appletviewer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to run any applets using appletviewer. This code is from the book "SAMS Teach Yourself Java in 24 hours".
This is the environment as shown by the MS-DOS SET command:
CLASSPATH = .;D:\jdk1.3.1\lib;D:\jdk1.3.
\lib\tools.jar;D:\jdk1.3.1
PATH=D:\jdk1.3.1\bin;%PATH%;
This is the source code (Downloaded from http://www.java24hours.com/):
import java.awt.*;
public class RootApplet extends javax.swing.JApplet {
int number;
public void init() {
number = 225;
}
public void paint(Graphics screen) {
Graphics2D screen2D = (Graphics2D) screen;
screen2D.drawString("The square root of " +
number +
" is " +
Math.sqrt(number), 5, 50);
}
}
The compile generates no errors, but this is the result when I run it:
D:\SamsJava>appletviewer RootApplet.html
Exception in thread "main" java.util.MissingResourceException: Cant find
resource for bundle sun.applet.resources.MsgAppletViewer, key
appletpanel.badattribute.exception
at java.util.ResourceBundle.getObject(ResourceBundle.java:382)
at java.util.ResourceBundle.getString(ResourceBundle.java:354)
at
sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:42)
at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:697)
at sun.applet.AppletPanel.init(AppletPanel.java:185)
at sun.applet.AppletViewer.<init>(AppletViewer.java:175)
at
sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.java:81)
at sun.applet.AppletViewer.parse(AppletViewer.java:1035)
at sun.applet.AppletViewer.parse(AppletViewer.java:969)
at sun.applet.Main.run(Main.java:140)
at sun.applet.Main.main(Main.java:82)

Is anyone able to shed some light on this?
I have re-installed jdk1.3.1 but that made no difference.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic