Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-28-2004, 04:36 PM   #1
Registered: Oct 2003
Distribution: Mandrake 9
Posts: 46

Rep: Reputation: 15
Java applet error: "Applet Failed"

First, here is my code:

import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;

public class firstApplet extends java.applet.Applet {
    Font f = new Font("TimesRoman",Font.BOLD,36);
    public void paint(Graphics g) {
        g.drawString("Hello World", 5, 50);
and my HTML file:

   <TITLE>Applet HTML Page</TITLE>

<H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3>

<APPLET codebase=.. code="firstApplet.class" width=350 height=200></APPLET>

<HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT>
I have been struggling to get my java applets to load. I eventually got the plugin installed correctly in Konqueror(I used to get a message saying the java plugin wasn't initialized), but now I am not able to load my applets.

I tried a second method to view the applets, I used the "appletviewer" that comes with the java SDK. Here is my out put:

[mike@localhost firstApplet]$ appletviewer firstApplet.html
java.lang.NoClassDefFoundError: firstApplet/firstApplet (wrong name: firstApplet)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at sun.applet.AppletClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at sun.applet.AppletClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at sun.applet.AppletClassLoader.loadCode(
at sun.applet.AppletPanel.createApplet(
at sun.applet.AppletPanel.runLoader(

The appletviewer does appear, but at the bottom it says "Start: applet not initialized".

If you know of a seperate program that can view applets outside a browser's plugins, I would be more than happy to hear about it.

All help is always appreciated :-)

Old 08-28-2004, 05:52 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,781

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
appletviewer worked for me with both your applet and html only after I replaced codebase=.. by codebase="."


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
"Add/Remove Applications" applet issue tom_from_van Linux - Newbie 5 07-23-2005 02:07 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
removing "Java Applet window" label blahJake Programming 3 06-14-2004 01:22 PM
does failed using urpmi messed up my "Install Software" / "mandrake update" ??? sirpelidor Mandriva 1 11-02-2003 09:00 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration