By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

run Java applet with <param> from HTML

P: n/a

This is simple HTML, Java but I am really confused. I include the code since
it is so small -

----------------------------------------------------------------------------

-- test.html --

<html>
<head>
<title>
run Java applet
</title>
</head>

<body>
<applet code="ContentExtractionApplet.class" width="580" height="25">
<param name="fontName" value="Arial"/>
<param name="fontSize" value="12"/>
<param name="msg" value="http://english.pravda.ru/news/world/25-04-2007"/>
</applet>
</body>
</html>

-- ContentExtractionApplet.java --

import java.applet.Applet;
import java.awt.*;

public class ContentExtractionApplet extends Applet {
// private representation

Label msgLabel;
Font msgFont;

/* this is called by the browsers JVM when applet is instantiated */

public void init()
{
// setting the applet Layout
setLayout(new BorderLayout());

msgFont = new Font(getParameter("fontName"),Font.BOLD,
Integer.parseInt(getParameter("fontSize")));
msgLabel = new Label(getParameter("msg"));
msgLabel.setFont(msgFont);

add(BorderLayout.CENTER,msgLabel);
}
}
--------------------------------------------------------------------------

The Java translates fine, and the applet runs when loaded in Mozilla Ff.

But if I replace "msg" with "message" in <paramand "msgLabel = ..." above
nothing shows up in my Ff browser :-(
Note a total of only 2 substitutions.

Any ideas what I am missing?

Thank you.

- Andrew M. Neiderer
US Army Research Laboratory
Apr 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Andrew Neiderer " <ne******@osprey.arl.army.milwrote in message
news:JH********@arl.army.mil...
|
| This is simple HTML, Java but I am really confused. I include the code
since
| it is so small -

<snip HTML>

|
| The Java translates fine, and the applet runs when loaded in Mozilla Ff.
|
| But if I replace "msg" with "message" in <paramand "msgLabel = ..."
above
| nothing shows up in my Ff browser :-(
| Note a total of only 2 substitutions.
|
| Any ideas what I am missing?

Your code looks fine. Are you sure you're clearing the browser's cache? It
may just be running the old applet.
Apr 27 '07 #2

P: n/a
Followup-to set: comp.infosystems.www.authoring.html

Andrew Neiderer wrote :
This is simple HTML, Java but I am really confused. I include the code since
it is so small -
Whenever you have a problem with a webpage, the very first things to do is
1- Validate the markup code of the page: if you find errors with that
webpage, then they have to be fixed. There is no other first steps to
perform. Removing markup errors may not fix the webpage issues or
problems but it might and it will definitely remove that source as
possible cause of the webpage's problems.

2- Validate the CSS code for the same reasons.

Most of the time (I'd say well above 75%), the layout problems can be
found and fixed with these 2 validation steps/process.

Why we won't help you by Mark Pilgrim
http://diveintomark.org/archives/200..._wont_help_you

----------------------------------------------------------------------------

-- test.html --

<html>
No doctype declaration. Your absence of doctype declaration will trigger
visual browsers into backward compatible mode (or quirks mode): in that
rendering mode, different browsers (and different versions of the same
browsers) will render webpage more differently. Instead, by declaring a
strict DTD in a doctype declaration, you would force browsers to conform
more closely to W3C web standards recommendations.
<head>
<title>
run Java applet
</title>
</head>

<body>
<applet code="ContentExtractionApplet.class" width="580" height="25">
<param name="fontName" value="Arial"/>
Have you checked your code with the HTML 4.01 recommendation? Where do
you see that an <appletcan have nested <param>

http://www.w3.org/TR/html4/struct/ob...ml#edef-APPLET

<param name="fontSize" value="12"/>
<param name="msg" value="http://english.pravda.ru/news/world/25-04-2007"/>
</applet>
</body>
</html>
- Andrew M. Neiderer
US Army Research Laboratory
Andrew,

please visit section
Using Web Standards in your Web Pages
2 Making your page using web standards: how to
Section 2.2.4.2 What if I use <applet>?
http://developer.mozilla.org/en/docs...your_Web_Pages

Followup-to set: comp.infosystems.www.authoring.html

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.