473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

run Java applet with <param> from HTML


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
2 3497

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lvcha.gouqizi | last post by:
I embed an applet in my php script which has a parameter providing an input file for the jar. Does this file has size limit? The code is as follows: <APPLET ARCHIVE="myapplet.jar" WIDTH=372...
1
by: Kenneth Montgomery | last post by:
I have this embedded dropdown menu applet that is suppose to be in the navigation frame and the target URL content in the content frame. But I can't seem to the script to put the content into the...
0
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format,...
1
by: M. Magistri | last post by:
Hi all! Why doesn't the following code load my applet under WinXP with Internet Explorer 6? <SCRIPT language="javascript" type="text/javascript"> <!-- if (getBrowser()=="IE"){...
0
by: Daimy | last post by:
I meet the same problem below, please help me! Thanks! //written by some one I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar...
0
by: Lloyd Sheen | last post by:
Ok, another IDE problem. Is there any way to stop the reformatting of the text in the HTML of an ASPX page???? I have an embedded object with lots of attributes / parameters and when I format...
2
by: Michael.Suarez | last post by:
The code in my DLL: /// <summary> /// db_task..file_master_list /// </summary> /// <param name="panConnection"> /// Pass the PanApp.Connection object by reference /// </param> /// <param...
8
by: Michael.Suarez | last post by:
So I wrote a DLL in 2.0. An example of one of the funtions is: /// <summary> /// db_task..file_master_list /// </summary> /// <param name="panConnection"> /// Pass the PanApp.Connection object...
1
by: dhillarun | last post by:
Hi all, I am displaying an applet and passing values to it by using a php file. I am sending the values to the applets by using PARAM (HTML) tag. But , I want to get some values into PHP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.