modern replacement for <Applet> tag

P

Paul Lutus

ToeCutter said:
hi,

I've written a little Java applet, but now that <applet> has been
deprecated, I'd love to get some help to show me the ideal <object> or
whatever the best current tag is.

Warning. Older browsers are not going to know how to handle anything but the
"deprecated" apple tag.

It is all fine and good to deprecate a tag, but as long as legacy browsers
remain in service, it is academic posturing, and no one should assume they
can stop using it.

At the very least, test your pages with all expected browsers.
^^^ those are some experiments, but none cover all browsers (IE,
opera, NN).

Surprise, surprise. The deprecated applet tag works with all of them.

You know, sometimes Sun relents and "un-deprecates" some things, the
original deprecation of which turned out to be a bad idea.
 
Z

zoopy

hi,

I've written a little Java applet, but now that <applet> has been
deprecated, I'd love to get some help to show me the ideal <object> or
whatever the best current tag is.

http://www.reefnerds.com/ChemPlot/ChemPlot.html
http://www.reefnerds.com/ChemPlot/ChemPlot2.html
http://www.reefnerds.com/ChemPlot/ChemPlot3.html

^^^ those are some experiments, but none cover all browsers (IE,
opera, NN). Thanks in advance for any help

This is the offical guide:

<http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html>

but unless you're required to create documents following the strict versions of HTML4 or XHTML
specs, I'd stick to the applet tag. And, as Paul pointed out, almost every browser supports it.
 
L

Liz

C

Cid

Check out htmlconverter in your jdk bin folder. Converts <applet>
usage to equivilent <object> usage.
 
P

Paul Lutus

Liz said:
Reading that link, it seems that those folks first
depreciated it then deprecated it. (-_-)

I concur. They did both. :)

But I think they are going to eat their deprecation.
 
A

Andrew Thompson

I've written a little Java applet,

Nice. Note that if you attach a Listener
to the the RadioButton group, you could
trigger a recalculation without requiring
the user to click 'Ok'.

Why are you using Swing buttons?
..but now that <applet> has been
deprecated, I'd love to get some help to show me the ideal <object> or
whatever the best current tag is.

No such beast has been found, you can butcher a
perfectly valid (3.2 or 4.01 transitional) HTML
applet tag with HTMLConverter, but it produces
invalid, JS (browser-sniffing) HTML that will
be unreadable and unmaintainable.

If you *want* to do that, you need to start with
a robust applet tag in HTML..

...which both those applet tags are not. Each
lacks an 'alt' and 'alternate HTML'. Given
the applet uses Swing, a better alternative
for versioning might be the JavaVersionApplet.
<http://www.physci.org/codes/jre.jsp>

(and continue to use the applet
tag and 4.01 transitional HTML)

This one does not work at all, in IE 6 or Mox 1.3.

I notice it specifies a codebase, but not the code
archive. Is that your intent?
^^^ those are some experiments, but none cover all browsers (IE,
opera, NN).

Nothing does, or will, cover all browsers,
you would have a hard time adequately supporting
Java in Lynx, the best you can hope for is
to give the user meaningful information on
why they do not get the applet, and possible
alternatives.
Thanks in advance for any help

You're welcome.
 
A

Andrew Thompson

Check out htmlconverter in your jdk bin folder. Converts <applet>
usage to equivilent <object> usage.

It produces invalid, unmaintainable HTML
though.. There are good reasons to stick with
HTML 4.01 Transitional and use applet tags.
 
T

Tor Iver Wilhelmsen

Andrew Thompson said:
It produces invalid, unmaintainable HTML
though..

Not if you thumb your nose at Netscape 4 users and pick the option
that generates OBJECT element only (the MSIE option if memory serves).
 
C

Cid

Not if you thumb your nose at Netscape 4 users and pick the option
that generates OBJECT element only (the MSIE option if memory serves).

Man I hate the browser wars. I wish developers would just refuse to
use any product that diverges from the standard and thereby force
compliance.
 
M

Michael Borgwardt

Cid said:
Man I hate the browser wars. I wish developers would just refuse to
use any product that diverges from the standard and thereby force
compliance.

The problem is that

A) it takes time for new features to get standardized. People want to use
them *now*, not in two years.

B) It's not only about developers. It would be nice if browsers refused
to render incorrect HTML instead if trying to cope in incompatibility-creating
ways, but to the user, it's the browser that's broken, not the page.
 
T

Tor Iver Wilhelmsen

Cid said:
Man I hate the browser wars. I wish developers would just refuse to
use any product that diverges from the standard and thereby force
compliance.

EXACTLY! That means no stinking EMBED - which violates HTML in so many
ways it should be illegal - but OBJECT, which Netscape chose to ignore
in their "not invented here" frame of mind. If I am not mistaken, it's
supported in the new Netscape (Mozilla-based).
 
A

Andrew Thompson

(HTMLConverter)

( When using nested said:
Not if you thumb your nose at Netscape 4..

Are you sure they are the only ones?
..users and pick the option
that generates OBJECT element only (the MSIE option if memory serves).

I am beginning to suspect that even the browsers
that do not understand <OBJECT> can be adequately
covered by using a nested <OBJECT>/*<APPLET>* tag..

<http://www.physci.org/test/appletcall/>
 
A

Andrew Thompson

I've written a little Java applet, but now that <applet> has been
deprecated, I'd love to get some help to show me the ideal <object> or
whatever the best current tag is.

How 'modern' do you want?

The best, most robust and valid experiments that
I have produced for combining <OBJECT><APPLET>
elements in HTML can be seen here..
<http://www.physci.org/test/appletcall/index5.html>
...and, here.
<http://www.physci.org/test/appletcall/index6.html>

Take your pick, but be warned that the second* has yet
to be torn apart and robustly reconstructed by the JS
gurus.. [ It only consists of 6 lines of JS, so I'm
hoping to have made fewer than 11 mistakes.. ;-) ]
 
M

Mickey Segal

Andrew Thompson said:
The best, most robust and valid experiments that
I have produced for combining <OBJECT><APPLET>
elements in HTML can be seen here..
<http://www.physci.org/test/appletcall/index5.html>
..and, here.
<http://www.physci.org/test/appletcall/index6.html>

Take your pick, but be warned that the second* has yet
to be torn apart and robustly reconstructed by the JS
gurus.. [ It only consists of 6 lines of JS, so I'm
hoping to have made fewer than 11 mistakes.. ;-) ]

Using Internet Explorer 6 SP1 on Windows XP SP1 the index6 example always
places a small grey rectangle over part of the browser's menu. The browser
has the Microsoft JVM as the default and Sun 1.5 beta 2 available. No
problem with the index5 example.

Is there a purpose to preferring the OBJECT tag other than wanting to invoke
the Sun JVM preferentially? We froze our huge applet at Java 1.1 because of
users needing that environment and see much better flicker-free changing of
GUI components with the Microsoft JVM (suggestions are always welcome).
 
A

Andrew Thompson

Using Internet Explorer 6 SP1 on Windows XP SP1 the index6 example always
places a small grey rectangle over part of the browser's menu.

...hmmm. Odd. I tested in 6.00.26 on XP,
(I am not sure what the SP1's are.. but I
got several years worth of critical security
updates the other night, 'SP1' sounds familiar..)
..The browser
has the Microsoft JVM as the default and Sun 1.5 beta 2 available. No
problem with the index5 example.

Same set-up here. ..Wait a second.
I have the 1.5 beta set as default.

OK,.. my test with the MSVM selected as default
fails as well, in a different way. The page fails
to load completely and shows the OBJECT element(?!?)

But then.. who besides developers are likely to have
the Sun Java installed, but the MSVM selected as default?

Does it work when you have either
a) both selected, or..
b) only the Sun VM selected

[ Here, the answer is yes to both. ]
 
M

Mickey Segal

Andrew Thompson said:
..hmmm. Odd. I tested in 6.00.26 on XP,
(I am not sure what the SP1's are.. but I
got several years worth of critical security
updates the other night, 'SP1' sounds familiar..)

My version is:
Version 6.0.2800.1106
OK,.. my test with the MSVM selected as default
fails as well, in a different way. The page fails
to load completely and shows the OBJECT element(?!?)

I see the word OBJECT for both your index5 and index6 examples.
Does it work when you have either
a) both selected, or..
b) only the Sun VM selected

All is fine with Sun VM selected. (I don't know how to select both JVMs.)

The gray rectangle that appears when using the MS JVM is in a constant place
near the top left of the screen, overlapping whatever is there.
 
A

Andrew Thompson

The gray rectangle that appears when using the MS JVM is in a constant place
near the top left of the screen, overlapping whatever is there.

I am pursuing a more robust approach (hopefully),
where I test for the TOP_ALIGNMENT attribute of
the applet from Javascript. I'll see if I can
come up with something more reliable for you to
have a look at.

[ Otherwise I'll toss this as a failed experiment
and stick with the applet element completely. ]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top