CheckOut my applet!  | | |
March 13th, 2003, 11:00 PM
|
#31 (permalink)
| | Member
Join Date: Mar 2003 Location: Kanata
Posts: 105
|
__________________
To think there might be giants.
|
| |
March 18th, 2003, 05:29 PM
|
#32 (permalink)
| | Member
Join Date: Feb 2003 Location: France
Posts: 55
| Quote: Originally posted by Tekk dangitall...what happened with it....it works fine from my Opera and IE browser.
Hrmmm....why does it work for me but not others...even tho its on the net | It's not a problem with the JVM. It's a problem with the Browser,
the JVM, the Java source code and the HTML source code combined.
APPLET tags worked fine until new and improved things like swing
components came along and various browsers implemented their own
JVM.
The underlying problem is that in the HTML source code you've
just used the simple Applet tags. As far as I can see, everyone
that is having the problems viewing your Applet is using some
version of Internet Explioter ahmm, I mean Explorer. From
studying this recurrent problem, I've come to the conclusion
that...
IE will display an Applet defined with APPLET tags if it's using
fairly simple (or early version) classes. But if you use newer
(swing) classes like in your Applet you need to use the OBJECT
tag. As far as I'm aware Netscape doesn't have the same problem
but it uses the EMBED tag to inform the user if they need to
upgrade their Plugin.
This brings me back to the humble APPLET tag. If someone tries
to view an Applet and they see nothing (or a grey box), they
don't know what to do. Using the OBJECT & EMBED tags in the
HTML source will interrupt the browser and force it to use Sun's
Java Runtime Environment (JRE) to run the applet. Code: <BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName).indexOf("Microsoft") != -1)
document.writeln(
"<OBJECT CLASSID='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' " +
"CODEBASE='http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_02-windows-i586.cab#Version=1,4,0,0' " +
"WIDTH=900 HEIGHT=340>" +
"<NOEMBED><XMP>");
else if (navigator.appName=="Netscape")
document.writeln(
"<EMBED PLUGINSPAGE='http://java.sun.com/webapps/getjava/BrowserCheck' " +
"TYPE='application/x-java-applet;jpi-version=1.4.1' " +
"CODE=TellerViewApplet.class WIDTH=900 HEIGHT=340>" +
"<NOEMBED><XMP>");
-->
</SCRIPT>
<APPLET CODE=TellerViewApplet.class WIDTH=900 HEIGHT=340>
</XMP>
<PARAM NAME="code" VALUE="TellerViewApplet.class">
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4.1">
No Java 2 Support For APPLET!
</APPLET>
</NOEMBED>
</EMBED>
</OBJECT>
<CENTER>
</BODY> It tells IE specifically to use the JVM Plugin if it's got the
up-to-date version. If not, it knows where to download it from.
It also enables Netscape Navigator to direct the user to a
location where they can download the latest Plugin for their
browser if they need it. But if the browser is not MS or
Netscape, the APPLET tags get used. The only problem I've
come across is when you set Opera to identify as IE v5.0 but
that's quickly fixed by hitting 'F12' and selecting Opera.
&n bsp; Usefull links...
The newest Java Plugin http://java.sun.com/webapps/getjava/BrowserCheck
The CLASSID="clsid:8AD.... explained http://java.sun.com/products/plugin/versions.html
HTML Convertor http://java.sun.com/products/plugin/.../htmlconv.html
More info on OBJECT/EMBED tags http://java.sun.com/j2se/1.4/docs/gu...sing_tags.html
DaveMark
--------------------------------------------
Imagination is more important than knowledge.
-- Albert Einstein
--------------------------------------------
Last edited by DJDaveMark : December 30th, 2003 at 09:32 AM.
|
| |
March 19th, 2003, 09:08 AM
|
#33 (permalink)
| | Space for Sale! :p
Join Date: Oct 2001 Location: La Isla del Encanto
Posts: 5,836
|
Nice info.! 
__________________
boo!
|
| |
April 18th, 2003, 11:54 AM
|
#34 (permalink)
| | Member
Join Date: Feb 2003 Location: France
Posts: 55
|
I've changed the first 'if' statement which will accomodate anyone spoofing with Opera. Code: <script language="JavaScript">
<!--
if (((navigator.appName).indexOf("Microsoft") != -1) && ((navigator.appVersion).indexOf("Opera") == -1 ))
document.writeln('<OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_02-windows-i586.cab#Version=1,4,0,0" WIDTH=900 HEIGHT=340><NOEMBED><XMP>');
else if (navigator.appName=="Netscape")
document.writeln('<EMBED PLUGINSPAGE="http://java.sun.com/webapps/getjava/BrowserCheck" TYPE="application/x-java-applet;jpi-version=1.4.1" CODE="TellerViewApplet.class" WIDTH=900 HEIGHT=340><NOEMBED><XMP>');
-->
</script>
<applet code="TellerViewApplet.class" width="900" height="340"></XMP>
<param name="code" value="TellerViewApplet.class">
<param name="type" value="application/x-java-applet;jpi-version=1.4.1">
No Java 2 Support For APPLET!<br>
<a href="http://java.sun.com/webapps/getjava/BrowserCheck">
Download The Plugin Here!
</a>
</applet>
Last edited by DJDaveMark : April 19th, 2003 at 01:29 PM.
|
| |
April 18th, 2003, 11:59 AM
|
#35 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: NC
Posts: 1,337
|
Not working here.. Win NT/ IE 6.0
__________________
No one dies a virgin, Life screws us all.
|
| |
April 18th, 2003, 12:15 PM
|
#36 (permalink)
| | Ultimate Member
Join Date: Mar 2003 Location: Kanada
Posts: 1,044
|
Worked for me...IE6, XP pro |
| |
April 18th, 2003, 12:19 PM
|
#37 (permalink)
| | Member
Join Date: Feb 2003 Location: France
Posts: 55
|
Hey Cruez,
What didn't work?
Did you get a picture outline?
Or a grey box with a red cross in the top left corner?
Any JavaScript errors in the status bar? if so, what?
What's in the Java Console?
Do you have a Java Plugin?
I've tested the code in IE 6.0, Netcape 7.02 & 4.0, Opera 6.01 & 7.03 and they all worked fine!
Anyone else with probs?
DaveMark |
| |
April 18th, 2003, 12:50 PM
|
#38 (permalink)
| | Member
Join Date: Feb 2003 Location: France
Posts: 55
|
Sorry folks, I amendmended the last code block for handling Opera spoofing Code: if (((navigator.appName).indexOf("Microsoft") != -1) && ((navigator.appVersion).indexOf("Opera") == -1 )) Was that the trouble Cruez?
("Opera") == -1 instead of ("Opera") != -1
DaveMark
Last edited by DJDaveMark : April 19th, 2003 at 01:31 PM.
|
| |
May 14th, 2003, 09:02 AM
|
#39 (permalink)
| | Member
Join Date: Apr 2002 Location: Georgia
Posts: 137
|
Folks, if it isn't working for you, you simply need to upgrade your JVM for your current browser to the Sun 1.4.1 version listed above in that extremely useful commentary.
Tekk, I would recommend that, next time, you use the lowest-common-denominator principle here. That means, simply, that you decide what the lowest version of the Java API that you want to support, and only use calls which are exclusively in that API. Also test on a machine using that JVM. Also, there are bugs in the Microsoft JVMs, but instead of making your user have to download a new JVM, your software will be considered more user-friendly if it simply does not use the buggy functions. That is a guess-and-check method. In other words, if it works correctly in appletviewer, but not in your default JVM which came with your Internet Explorer, then try to pinpoint which functions are failing, and then hand-implement those.
Although, for a school project, I wouldn't go through all that trouble  (Do that if you are working for a company, though---assuming they want the broadest range of people to be able to use your applets)
__________________
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
|
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |