A
Andrew Neiderer
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 <param> and "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
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 <param> and "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