Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Unable to run an applet with appletviewer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
Hey cool! They got a blimp! But I have a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic