aspose file tools*
The moose likes Applets and the fly likes Internet Explorer 5.0 and Applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Internet Explorer 5.0 and Applets" Watch "Internet Explorer 5.0 and Applets" New topic
Author

Internet Explorer 5.0 and Applets

Andrew Brodie
Greenhorn

Joined: Oct 24, 2000
Posts: 15
I am using IE5.0 and just getting started with applets. I am also using Oracle JDeveloper 3.0 to develop applets and other Java programs.
I understand I am not alone when I say that I can not get a simple applet to load in IE. I have played around with my classpath variable and the codebase and code parameters inside the applet tags. Nothing I have done will let me run applets and the same error occurs everytime, "xxx class not found".
If anybody has any insight into getting applets to run under IE5.0 please let me know.
Thanks


SCJP
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Andrew,
Could you post your code (*.java and *.html files) so that it is easier to determine what is causing the error?
Thanks.
Stephanie
Brooks Duncan
Greenhorn

Joined: Oct 16, 2000
Posts: 5
Are you using SWING components? If so, you'll need to install the Java Plug-In in order to get IE to display them. If you don't have it, you can get the error that you've described.
-B
Ram Ashish
Greenhorn

Joined: Oct 16, 2000
Posts: 2
Originally posted by Andrew Brodie:
I am using IE5.0 and just getting started with applets. I am also using Oracle JDeveloper 3.0 to develop applets and other Java programs.
I understand I am not alone when I say that I can not get a simple applet to load in IE. I have played around with my classpath variable and the codebase and code parameters inside the applet tags. Nothing I have done will let me run applets and the same error occurs everytime, "xxx class not found".
If anybody has any insight into getting applets to run under IE5.0 please let me know.
Thanks

Ram Ashish
Greenhorn

Joined: Oct 16, 2000
Posts: 2
Sorry about the previous one!
You would have to use the Java Plug-in and also the html converter to get it to show up.
The html converter would put in the additional tags necessary for the applet to show up on the browser.
Both are avaiable for free download from the javaosft website, under products.
Hope that helps,
Ashish
Andrew Brodie
Greenhorn

Joined: Oct 24, 2000
Posts: 15
Originally posted by Stephanie Grasson:
Andrew,
Could you post your code (*.java and *.html files) so that it is easier to determine what is causing the error?
Thanks.
Stephanie

HERE IS HOW MY CLASSPATH IS SET (I know a little messed!)
set CLASSPATH=.;C:\Program Files\JavaSoft\JRE\1.3;c:\java\myclasses;C:\Program Files\Oracle\JDeveloper 3.0\myclasses;
HERE IS THE HTML GENERATED BY JDEVELOPER
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
HTML Test Page
</TITLE>
</HEAD>
<BODY>
HandsOn.MyApplet1 will appear below in a Java enabled browser.<BR>
<APPLET
CODEBASE = "."
CODE = "HandsOn/MyApplet1.class"
NAME = "TestApplet"
WIDTH = 400
HEIGHT = 300
HSPACE = 0
VSPACE = 0
ALIGN = middle
>
</APPLET>
</BODY>
</HTML>


HERE IS THE APPLET CODE - I USED ORACLE JDEVELOPER AND ALL THIS DOES IS BRING UP AN EMPTY APPLET WINDOW, AND IT WORKS IN JDEVELOPERS APPLET VIEWER. (I don't see the point of going further until my environment is working)

package HandsOn;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class MyApplet1 extends JApplet {
boolean isStandalone = false;
//Get a parameter value

public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
//Construct the applet

public MyApplet1() {
}
//Initialize the applet

public void init() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
//Component initialization

private void jbInit() throws Exception {
this.setSize(400,300);
}
//Get Applet information

public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info

public String[][] getParameterInfo() {
return null;
}
}
-----
Any help is very much appreciated. When I get this working I will share the solution. I know a lot of people with the same problem.

Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Hey,
Others have said this but perhaps it wasn't clear. IE doesn't support Swing on its own. You have to install a plugin. You're using a JApplet. If you use an Applet instead (and remove any other swing components[not sure about jbinit]), then you won't have any troubles.
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Andrew,
The other posters have given some good advice. Make sure your browser is Swing-enabled and be sure to use the HTML-converter. More information about it can be found here:
http://java.sun.com/products/jfc/tsc/articles/converter/converter.html
I ran your html file through the converter. The result is below:

Then it ran fine for me in IE 5.0.
Give it a try. If it still doesn't work, let us know.
Good luck.
Stephanie
Brian Chiu
Greenhorn

Joined: Dec 09, 2000
Posts: 3

Hi, Ram,
Could you tell me where to download java plug-in or
html converter ? Thanks !
Brian

Originally posted by Ram Ashish:
Sorry about the previous one!
You would have to use the Java Plug-in and also the html converter to get it to show up.
The html converter would put in the additional tags necessary for the applet to show up on the browser.
Both are avaiable for free download from the javaosft website, under products.
Hope that helps,
Ashish

Brian Chiu
Greenhorn

Joined: Dec 09, 2000
Posts: 3

Hi,
I met the same problem. Your original code may be like this:
<APPLET CODE="HelloWorldApplet.class" Width=200 Height=150 >
</APPLET>
modify like below:
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="200" height="200" >
<PARAM NAME="code" VALUE="HelloWorldApplet.class">
</OBJECT>
Holp it can work. Detail information you can consult this web site:
http://java.sun.com/products/plugin/1.2/docs/tags.html#IENN
Brian
Originally posted by Andrew Brodie:
I am using IE5.0 and just getting started with applets. I am also using Oracle JDeveloper 3.0 to develop applets and other Java programs.
I understand I am not alone when I say that I can not get a simple applet to load in IE. I have played around with my classpath variable and the codebase and code parameters inside the applet tags. Nothing I have done will let me run applets and the same error occurs everytime, "xxx class not found".
If anybody has any insight into getting applets to run under IE5.0 please let me know.
Thanks

 
 
subject: Internet Explorer 5.0 and Applets