Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Problem with creating an applet

Thread view: 
René Beltman - 22 Dec 2005 20:29 GMT
Hello everyone,

For a test with applets I wanted to create an applet.

The applet code:
import javax.swing.*;
import java.awt.*;

public class ByeWorld extends JApplet {

public void init() {
 Container contentPane = getContentPane();
 JLabel label = new JLabel("Goodbye world",SwingConstants.CENTER);
 contentPane.add(label);
}
}

The HTML file:
<html>
<head>
 <title>Test</title>
</head>

<body>
<applet code="ByeWorld.class" width="200" height="300"></applet><br />
Hieronder staat een test met een applet
</body>
</html>

At running of the applet I get the following exception:

Exception in thread "Thread-6" java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at sun.applet.AppletPanel.getAccessControlContext(Unknown Source)
at sun.applet.AppletPanel.getClassLoader(Unknown Source)
at sun.applet.AppletPanel.createAppletThread(Unknown Source)
at sun.applet.AppletPanel.init(Unknown Source)
at sun.plugin.AppletViewer.createClassLoader(Unknown Source)
at sun.plugin.AppletViewer.appletInit(Unknown Source)
at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)

Where the text Thread-6, the number vary's on the number of times I tried to
access the webpage.
ps. Mozilla is giving the exception:
Exception in thread "Thread-2" java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at sun.applet.AppletPanel.getAccessControlContext(Unknown Source)
at sun.applet.AppletPanel.getClassLoader(Unknown Source)
at sun.applet.AppletPanel.createAppletThread(Unknown Source)
at sun.applet.AppletPanel.init(Unknown Source)
at sun.plugin.AppletViewer.createClassLoader(Unknown Source)
at sun.plugin.AppletViewer.appletInit(Unknown Source)
at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
at sun.plugin.viewer.WNetscapePluginObject$Initer.run(Unknown Source)

Does anyone know how to solve this problem? Thanks in advantage.

Greetings,

René Beltman.
Danno - 22 Dec 2005 20:44 GMT
Given that you are suicidal, I don't think I want to help you solve it.
Oliver Wong - 22 Dec 2005 21:00 GMT
> Hello everyone,
>
[quoted text clipped - 12 lines]
> }
> }

[snip]

> Exception in thread "Thread-6" java.lang.IllegalArgumentException
> at sun.net.www.ParseUtil.decode(Unknown Source)
[quoted text clipped - 9 lines]
> at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
> at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)

   Did you try running it using the AppletViewer? I just did and it seems
to run fine on my side.

   - Oliver
zero - 23 Dec 2005 18:40 GMT
> Hello everyone,
>
[quoted text clipped - 22 lines]
>  <applet code="ByeWorld.class" width="200" height="300"></applet><br
>  /> Hieronder staat een test met een applet

bedoel je niet hierboven?  ;-)

>  </body>
> </html>
[quoted text clipped - 3 lines]
> Exception in thread "Thread-6" java.lang.IllegalArgumentException
>  at sun.net.www.ParseUtil.decode(Unknown Source)

It looks like your classpath has an error.  Check if all the directories in
the classpath have valid names and exist.

Signature

Beware the False Authority Syndrome



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.