Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

appletviewer error

 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have I not done correctly?
APPLET
package Wrapper;
import javax.swing.*;
import java.awt.*;
import javax.swing.border.*;
/*
*Learning to Create Windows
*Doco Mastadon
*02/23/03
*/
public class TryApplet extends JApplet
{
public void init ()
{
Container content = getContentPane ();//get content pane
content.setLayout (new FlowLayout (FlowLayout.RIGHT));//set layout
JButton button;//stores a button
Font[] fonts = { new Font ("Arial", Font.ITALIC, 10),
new Font ("Playbill", Font.PLAIN, 14)//two fonts
};
BevelBorder edge = new BevelBorder (BevelBorder.RAISED);//beveled border
//add the buttons using alternate fonts
for (int i = 1; i <= 6; i++)
{
content.add (button = new JButton ("Press " + i));//add the buttons
button.setFont (fonts[i % 2]);// one of our own
button.setBorder (edge);
}
}
}
HTML
<APPLET CODE="TryApplet.class" LANGUAGE=JAVASCRIPT WIDTH=300, HEIGHT=200>
</APPLET>
C:\appletviewer TryApplet.html
Produces the following error:
Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle sun.applet.resource.MsgAppletViewer, key appletpanel.badattribute.exception, etc.
TIA
doco
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am beginning to wonder why bother with JAVA altogether if Gates controls 80%+ machines in the world and he stubbornly resists allowing use of Applets and other issues.
I have tried every posted fix for the above problem listed clear back to the beginning of the year and nothing works.
I have IE6 with XP OS. Applets simply will not work. VBScript is looking better all the time. :roll:
doco
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi doco,
first thing.
if u post something against java on JavaRanch you should be "absolutely" sure that its not your fault.
in this case it is your fault.
change your html. you don't follow standard HTML syntax.
you have comma in APPLET tag after width. that is invalid.
i got the same exception that you have but it was gone as soon as i corrected the comma error.
another thing, i don't understand the use of Language=JavaScript thing in Applet tag...where do you find this? i have never used it...
regards
maulin.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi doco,
sorry if my wordings sounded little rude but somehow i couldn't just accept things without 100% surity about java not working ...you know...
regards
maulin.
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maulin;
No need for an appology, if I have a but chewing coming I'll take it. I was being entirely more rhetorical than necessarily critical. Nearly every post I read dealing with this issue was something to do with IE incompatiblily with JAVA; which caused me to wonder outloud.
doco
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic