aspose file tools*
The moose likes Beginning Java and the fly likes Problem Running Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem Running Applet" Watch "Problem Running Applet" New topic
Author

Problem Running Applet

Azam Bukhari
Ranch Hand

Joined: Oct 03, 2000
Posts: 58
Dear Community, i am getting problem in running this damn applet..as soon as i press enter typing
the appletviewer blabla.htm on the prompt i got the following msg...
Is My JDK has gone Corrupt or i have to edit the path in autoexec.bat...
Help Me Please!!
C:\jdk1.3\bin>appletviewer my.html
Exception in thread "main" java.util.MissingResourceException: Can't find resour
ce 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.jav
a: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)



Don't wanna invent the wheel again!!
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Azam,
This usually comes about because of syntax errors inside the HTML. Common mistake:
Make sure you are using actual pixel values for height and width. The appletviewer doesn't support percentages. For example:
WIDTH="50%" not good
WIDTH=350 good
Regards,
Manfred.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Hello Azam,
What happens when you try to view the html file with a browser like Internet Explorer or Netscape?
Are you having this problem with the simplest example. Like:

And the html file could look like:

Post your code. Let's have a look.
Good Luck,
-Dirk Schreckmann


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Azam Bukhari
Ranch Hand

Joined: Oct 03, 2000
Posts: 58
Dear Sir/Friends:-
thanx a lot, the mistake was on my side...i didn't write the HTML correctly...

But still, the browser didn't show up the applet
if i directly click the html file but the applet runs very well with appletviewer command....
sorry for botherin for such a ridiculous stuff but still if you guyz can help me.. help me out!!
Thanx again
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
What browser are you using? What version of Java are did you code in? Do you have the browser plug-in to support that version of Java? Many browsers only support up to java 1.1.8 without a plug-in.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Azam Bukhari
Ranch Hand

Joined: Oct 03, 2000
Posts: 58
Sir,
i am using IE-5.5 on Win 98 platform, plus i m using jdk1.3 version.
and i store my files in a seperate directory called mywork & not in jdk1.3\bin
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Yes, well, you need to let WINDOWS know what you are doing. All this path and classpath stuff that we keep talking about is only good for applications not applets. If you are using IE - it is pointing at a Windows version of java. The place for a browser to go look for the JDK is kept in the Windows registry.
When you download the plug-in for the 1.3 version of Java the Windows registry is automatically updated.
You can read the instructions and find the download here.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem Running Applet