home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

CheckOut my applet!

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2086
Discussions: 200,974, Posts: 2,379,786, Members: 246,337
Old March 13th, 2003, 11:00 PM     #31 (permalink)
Member
 
Wolfreakyn's Avatar
 
Join Date: Mar 2003
Location: Kanata
Posts: 105
Anybody that can't use it go to http://java.sun.com/getjava/
and get the real runtime.
__________________
To think there might be giants.
Wolfreakyn is offline   Reply With Quote
Old March 18th, 2003, 05:29 PM     #32 (permalink)
Member
 
DJDaveMark's Avatar
 
Join Date: Feb 2003
Location: France
Posts: 55
Re: CheckOut my applet!

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.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.
DJDaveMark is offline   Reply With Quote
Old March 19th, 2003, 09:08 AM     #33 (permalink)
Space for Sale! :p
 
eagle1's Avatar
 
Join Date: Oct 2001
Location: La Isla del Encanto
Posts: 5,836
Nice info.!
__________________
boo!
eagle1 is offline   Reply With Quote
Old April 18th, 2003, 11:54 AM     #34 (permalink)
Member
 
DJDaveMark's Avatar
 
Join Date: Feb 2003
Location: France
Posts: 55
Talking

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.
DJDaveMark is offline   Reply With Quote
Old April 18th, 2003, 11:59 AM     #35 (permalink)
Ultimate Member
 
Cruez's Avatar
 
Join Date: Oct 2001
Location: NC
Posts: 1,337
Send a message via ICQ to Cruez Send a message via AIM to Cruez
Not working here.. Win NT/ IE 6.0
__________________
No one dies a virgin, Life screws us all.
Cruez is offline   Reply With Quote
Old 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
haxxorpoop is offline   Reply With Quote
Old April 18th, 2003, 12:19 PM     #37 (permalink)
Member
 
DJDaveMark's Avatar
 
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
DJDaveMark is offline   Reply With Quote
Old April 18th, 2003, 12:50 PM     #38 (permalink)
Member
 
DJDaveMark's Avatar
 
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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instead of &nbsp;&nbsp;&nbsp;&nbsp;("Opera") != -1

DaveMark

Last edited by DJDaveMark : April 19th, 2003 at 01:31 PM.
DJDaveMark is offline   Reply With Quote
Old 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Ò®
Jüš† ä gü¥ is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3060)
Charges against non-tippers dropped.. (8)
The disrespect of Obama by Russian .. (49)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
Point and Shoot Camera Suggestions. (7)
windows 7 problem (7)
Internet Lost (5)
Multiple Restarts Required at Boot (5)
Recent Discussions
Multiple Restarts Required at Boot (5)
Point and Shoot Camera Suggestions. (7)
Delete an OS (16)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 11:28 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28