Getting applets to work in IE

How do I get applets to work with IE without downloading Sun java plugin?
I have the following html
<applet code=Foo.class width=100 height=100>
</applet>
This works great on Mozilla (both windoze and linux).
But IE complains that it cannot find the classfile Foo.class
If I install sun java plugin then it works fine on IE, but it doesnt work with the default microsoft jvm.
How do I get it to work in microsoft vm, as downloading sun plugins is a pain.
Thanks,

The applet has to use only classes and resources that exist in early version 1.1 Java (not sure of the exact version) and be compiled with that version compiler or use a compiler target option of 1.1. Because MS altered Java, there may still be incompatibilities with anyone else's Java.
Probably, IE complains about foo because it's using 1.2 or later features.

Similar Messages

  • Getting applets to work in Firefox or IE7!!

    Hi folks.
    I've been reading Jason Hunters excellet book on Java Servlet Programming and become rather stuck on being able to get applets to work in a browser.
    1) I managed to briefly get an Applet to work in IE7. Then things went astray (I say work, because applet initially displayed correctly graphically)
    2) I introduced a bug and tried to redisplay. And haven't been able to recover.
    3) When 2) occurred I swapped over to Firefox, since IE7 doesn't have a Java Console. (& theres no setting to enable it in security settings either)
    4) Then Firefox prompted to download JRE... This was an odd one to me.... Since I already had a Java runtime...
    I got this through downloading file java_app_platform_sdk-5_04-windows.exe
    java -version yeilds:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\Jeremy>java -version
    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
    C:\Documents and Settings\Jeremy>
    Browser Versions
    IE : is at version 7.0.5730.13
    Firefox started out at 2.0.0.12... Now Firefox didn't seem to detect the JRE
    5) It said additional plugins are required to display the media on this page...
    6) I clicked the button to "Install missing plugins"
    It then presents Plugin Finder Service with "Available Plugin Downloads" of Java Runtime Environment with checkbox ticked.
    7) I clicked "next", at which point it completes saying
    No plugins were installed
    Java Runtime Environment failed with "Manual Install" button...
    Clicking said button gave me executeable xpiinstall.exe from http://sdlc-esd.sun.com
    8) When I ran this it
    a) proceeded to cause Firefox to crash and a report was sent to Mozilla...
    b) created a restore point called "Installed Java (TM) 6 update 5..
    9)So now I went back to IE 7 having given up on Firefox...
    Now it complained about missing classes which I felt sure were in a jar I'd deployed in Tomcat...
    10) I tried to validate my assumptions by looking inside the Jar with Winzip...
    Then I got a pop up with "Java Virtual Machine Launcher" in its title saying..
    "Failed to load Main-Class manifest attribute from cos.jar"
    At this point I realised 8) was the culprit after posting here and looking at possible causes for said pop-up.
    [http://www.artima.com/forums/flat.jsp?forum=1&thread=61427&start=75&msRange=15]
    None of solutions posted there seemed to apply to me
    11) So now I restored to a restore point prior to 8) and though my problems were over
    12) I've since upgraded to Firefox 2.0.0.14. Firefox pushed update to me. Also tried manually uninstalling and downloading file. Still saying missing plugin!!!
    13) I've tried changing my tags in my html from
    APPLET to OBJECT for IE7 or EMBED for Firefox..
    I've validated my APPLET with APPLETVIEWER following advice posted here:
    [http://java.sun.com/docs/books/tutorial/deployment/applet/index.html]
    No tell tale signs appear in Tomcat Console or logs..
    *The only thing that seems weird is codebase tag*
    14) Book I've been reading mentioned putting both html code and applet class in root folder of tomcat
    I've hosted both files here:
    C:\Apps\apache-tomcat-6.0.16\webapps\ROOT
    15) When I test with appletviewer from this folder and codebase set to / appletviewer doesn't find class.
    I think I need to set this so when web browser runs it finds class. Maybe this is the route of my problems.
    What's haunting me here though is placeholder for applet graphic worked at one point!
    I don't recall fussing with codebase attribute of applet tag, yet suddenly things stopped working.
    16) When I tried to verify with appletviewer I had to remove codebase attribute completely to get things to work.
    Here are three versions of html file. Firefox version doesn't seem to be recognized by Appletviewer
    Applet tag version: (BTW have tried with CODEBASE=/ too. This was how it appeared in book, Remember I'm hosting in Tomcat 6.0.16)
    {code}
    <HTML>
    <HEAD><TITLE>Daytime Applet</TITLE></HEAD>
    <BODY>
    <CENTER><H1>Daytime Applet</H1></CENTER>
    <CENTER><APPLET CODE="DaytimeApplet.class" WIDTH=300 HEIGHT=180></APPLET></CENTER>
    </BODY></HTML>
    {code}
    IE Version only
    {code}
    <HTML>
    <HEAD><TITLE>Daytime Applet</TITLE></HEAD>
    <BODY>
    <CENTER><H1>Daytime Applet</H1></CENTER>
    <CENTER><object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="300" height="180">
    <param name="code" value="DaytimeApplet.class"></object></CENTER>
    </BODY></HTML>
    {code}
    Firefox version with JRE matching what java -version says precisely and using "jpi-version" so need for download instructions url 'should' be redundant..
    {code}
    <HTML>
    <HEAD><TITLE>Daytime Applet</TITLE></HEAD>
    <BODY>
    <CENTER><H1>Daytime Applet</H1></CENTER>
    <CENTER>
    <embed code="DaytimeApplet.class"
    width="300" height="180"
    type="application/x-java-applet;jpi-version=1.6.0_04"/>
    </CENTER>
    </BODY></HTML>
    {code}
    I don't want to be staring at a placeholder in a Web Browser.
    I want to GUI as it appears in AppletViewer and how it once had it working in IE7!
    You wouldn' t think that was to much to ask for would you! Sorry for length of this post.
    Any clues as to where to go next would be greatly appreciated as I'm pulling hairs out with frustration at the moment...
    A few of footnotes:
    1) I've relaxed my security zone settings for intranet, added localhost to local intranet sites..
    2) I've tried deleting all temporay files in IE7 even to point of resetting to install setup thinking there may be some sort of caching issue with bad applet... No luck
    3) I can still get Glassfish server to login to Admin Console.
    So the integrity of my pc should me intact based on the shenanigans of point 11. Restoring to get rid of second JRE

    paulcw wrote:
    I'm not sure what to tell you. I've never had any trouble installing the JRE and getting applets to work. Maybe it's an IE7 thing. Firefox is usually easier to configure.
    Anyway, it sounds like something that you need to be sitting at your computer to fix, so I don't know how useful a forum will be. It might be best just to ask a coworker with a lot of arcane knowledge to take a look at it.1) Unfortunately I'm learning from home and don't have the luxury of asking a co-worker. Have fired off email to one of folks at Sun..
    In my efforts to try and track down the problem yesterday, Google uncovered some interesting findings regarding Caching of Applets. Thought I'd share this:
    2) [http://www.velocityreviews.com/forums/t603400-ltobjectgt-tag-and-applet-caching.html]
    There is an interesting post some way down posted by james.a.cleland
    Quote:
    "My solution is to x-c in the Java console to clear
    this cache. This works without unloading the JVM and while the applet
    is running. It looks like the browser isn't caching any applets. At
    least my browser cache doesn't contain any, although I do regularly
    use half a dozen, so it must be the JRE. Anyway, clearing through the
    console solves my problem".
    I can't access Java Console in IE7 as you know...
    3) There is always another way to skin a cat regarding clearing cache.
    Found this here:
    [http://www.aurigma.com/Support/DocViewer/28/UpdatingImageUploaderonClientSide.htm.aspx]
    Search for Java section
    Quote:
    "Java applets are stored in the cache that is accessible through the Java control panel. Follow these steps to do it:
    Open Java Plug-in Control Panel. Depending on the platform, it can be found in different locations:
    Windows: Control Panel -> Java Plug-in
    Click the Cache tab.
    Click Clear to clear all cached applets."
    *Problem is that there is no Java Plug-In within Control panel. Mentioned this with Coffee Cup reference above..*
    4) Also saw this article on *"How to troubleshoot Java applet and component download problems"* at:
    [http://support.microsoft.com/kb/241111]
    Java console or output log section:
    Javalog.txt in the windows\java or winnt\java directory
    windows\java contains
    - classes
    - trustdb
    No such file: classes & trustdb are empty folders.
    5) I have same problem mentioned here:
    [http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=915520&SiteID=1]
    Quote:
    "I cannot get java applets to display on any web pages - instead this message appears:
    alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is completely ignoring the <APPLET> tag! "
    Yep. That's my predicament.
    BTW: Get this by doing test here:
    [http://java.sun.com/products/plugin/1.5.0/demos/applets/Clock/example1.html]
    6) Sun's Verify Installation fails on me too:
    [http://www.java.com/en/download/installed.jsp]
    7) I'm interested in knowing how IE7 caches the applets too. Does it store some sort of class-id in the registry? (I'm on XP SP2)
    8) Is there an installation integrity verifier for Sun? Something that verifies the integrity against a baseline install and reports anomalies.Like I mentioned earlier I've got java_app_platform_sdk-5_04-windows.exe file installed. Not the latest incarnation, but the one immediately before. With SE 1.6.0_04-b12 built built into it

  • Getting Applet to Work in an HTML Document

    I have written an Applet which works perfectly in the Applet Viewer, but crashes when I attempt to put it on my web page. The crash gives no errors, no exceptions, no nothing. Just a grey square with the words "Applet Crashed". I tried it both with the files in a .jar,and with all the files uncompressed, and used the W3C's code validator at http://validator.w3.org/ to verify that my HTML is correct.
    The HTML code using the .jar file is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <a bunch of HTML code>
    <object data="ComicTemplate.class" type="applet/java" archive="AICS.jar" WIDTH=620 HEIGHT=650>
    If you can read this, your broswer doesn't support Java. Go to Sun's website to get the latest version of Java. You may also need to turn on Java in your browser's preferences.
    </object>
    <more HTML>
    </html>
    The code without the .jar is the same, except that the archive lists the 8 .class files and 18 images used individually.
    Any advice?

    I tried it both ways. It works using either method in the applet viewer, but niether works in the browser.
    In the good news, however, I found a hidden Java console inmy browser, which did have some error messages. Cut-n-pasted:
    -- Opera Java Console --
    Java vendor: Sun Microsystems Inc.
    Java version: 1.4.1_02
    type 'h' for help
    java.security.AccessControlException: access denied (java.io.FilePermission Hunter.jpg read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
         at sun.awt.SunToolkit.getImageFromHash(SunToolkit.java:486)
         at sun.awt.SunToolkit.getImage(SunToolkit.java:500)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:81)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
         at Panel1.<init>(Panel1.java:24)
         at Comic.<init>(Comic.java:22)
         at ComicTemplate.<init>(ComicTemplate.java:26)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:306)
         at java.lang.Class.newInstance(Class.java:259)
         at com.opera.PluginPanel.run(PluginPanel.java:412)
         at java.lang.Thread.run(Thread.java:536)

  • Getting Applets to Work on the Web

    Last semester, I took a Java programming class. While polishing up my resume recently, I decided that a couple of assignments I did for the class would look good in my porfolio, and attempted to upload them to my website.
    Unfortunately, the class I took focused exclusively on getting applets to run on you local machine. Nothing I did for the class works in a web browser. This leads me to two questions:
    1) IMO, Java that doesn't work in a web browser pretty much defeats the purpose of using Java. Since my local college's Comp Sci program is obviously failing in this regard, what are good resources to learn the Right Way to program in Java (ie, the way that works in web browsers)?
    2) Are any of the things I did in class salvagable by any means short of starting over from scratch? Below is a cut-n-paste of a typical applet we wrote for the class, using the teacher's reccomended methods. If someone could point me in the right direction for getting this to work in a browser, I'd be very grateful.:
    <code>
    // Java Programming - CSCI-267
    // Assignment for week # 13
    // Filename AutoDatabase
    // Written by Mike 'siece' Gilmore
    // Written on Nov. 23 2k3
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    public class AutoDatabase extends Frame implements ItemListener, ActionListener{
    Connection conEmployees;
    Statement cmdEmployees;
    ResultSet rsEmployees;
    boolean blnSuccessfulOpen = false;
    Choice lstVehicle = new Choice();
    TextField txtInvID = new TextField(10);
    TextField txtMan = new TextField(10);
    TextField txtModName = new TextField(9);
    TextField txtYear = new TextField(14);
    TextField txtVID = new TextField(14);
    TextField txtCost = new TextField(14);
    Button btnAdd = new Button("Add");
    Button btnEdit = new Button("Edit");
    Button btnCancel = new Button("Cancel");
    Button btnDelete = new Button("Delete");
    Label lblMessage = new Label(" ");
    public static void main(String args[])
    AutoDatabase thisApp = new AutoDatabase();
    thisApp.createInterface();
    public void createInterface()
    loadDatabase();
    if(blnSuccessfulOpen)
    setTitle("Java Class Week 13 Assingment");
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent event)
    stop();
    System.exit(0);
    setLayout(new BorderLayout());
    Panel pnlTop = new Panel(new GridLayout(2,2,10,10));
    pnlTop.add(new Label("Inventory ID"));
    lstVehicle.insert("Select a Vehicle to Display", 0);
    lstVehicle.addItemListener(this);
    pnlTop.add(lstVehicle);
    pnlTop.add(new Label(" "));
    add(pnlTop, "North");
    Panel pnlMiddle = new Panel(new GridLayout(7,2,10,10));
    pnlMiddle.getInsets();
    pnlMiddle.add(new Label("Inventory ID"));
    pnlMiddle.add(txtInvID);
    pnlMiddle.add(new Label("Manufacturer"));
    pnlMiddle.add(txtMan);
    pnlMiddle.add(new Label("Model Name"));
    pnlMiddle.add(txtModName);
    pnlMiddle.add(new Label("Year"));
    pnlMiddle.add(txtYear);
    pnlMiddle.add(new Label("Vehicle ID"));
    pnlMiddle.add(txtVID);
    pnlMiddle.add(new Label("Cost"));
    pnlMiddle.add(txtCost);
    setTextToNotEditable();
    Panel pnlLeftButtons = new Panel (new GridLayout(0,2,10,10));
    Panel pnlRightButtons = new Panel(new GridLayout(0,2,10,10));
    pnlLeftButtons.add(btnAdd);
    btnAdd.addActionListener(this);
    pnlLeftButtons.add(btnEdit);
    btnEdit.addActionListener(this);
    pnlRightButtons.add(btnDelete);
    btnDelete.addActionListener(this);
    pnlRightButtons.add(btnCancel);
    btnCancel.addActionListener(this);
    btnCancel.setEnabled(false);
    pnlMiddle.add(pnlLeftButtons);
    pnlMiddle.add(pnlRightButtons);
    add(pnlMiddle,"Center");
    add(lblMessage, "South");
    lblMessage.setForeground(Color.red);
    setSize(400, 350);
    setVisible(true);
    else {
    stop();
    System.exit( -1);
    public Insets insets()
    return new Insets(40, 15, 15, 15);
    public void loadDatabase()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException err)
    try
    Class.forName("com.mx.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException error)
    lblMessage.setText("Drivers did not load properly");
    try
    conEmployees = DriverManager.getConnection("jdbc:odbc:AutoDatabase");
    cmdEmployees = conEmployees.createStatement();
    rsEmployees = cmdEmployees.executeQuery("Select * from Vehicle;");
    loadNames(rsEmployees);
    blnSuccessfulOpen = true;
    catch(SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void loadNames(ResultSet rsEmployees)
    try
    while(rsEmployees.next())
    lstVehicle.add(rsEmployees.getString("InventoryID"));
    catch(SQLException error)
    lblMessage.setText("Error in Display Record." + "Error: " + error.toString());
    public void itemStateChanged(ItemEvent event)
    String strInventoryID = lstVehicle.getSelectedItem();
    lblMessage.setText("");
    try
    rsEmployees = cmdEmployees.executeQuery(
    "Select * from Vehicle where [InventoryID] ='" + strInventoryID + "';");
    txtInvID.setText(strInventoryID);
    displayRecord(rsEmployees);
    setTextToEditable();
    catch(SQLException error)
    lblMessage.setText("Error in result set." + "Error: " + error.toString());
    public void displayRecord(ResultSet rsEmployees)
    String strFormat;
    float fltCost;
    try
    if(rsEmployees.next())
    txtInvID.setText(rsEmployees.getString("InventoryID"));
    txtMan.setText(rsEmployees.getString("Manufacturer"));
    txtModName.setText(rsEmployees.getString("ModelName"));
    txtYear.setText(rsEmployees.getString("Year"));
    txtVID.setText(rsEmployees.getString("VehicleID"));
    NumberFormat fmtCurrency = NumberFormat.getCurrencyInstance();
    NumberFormat fmtDecimal = NumberFormat.getInstance();
    fltCost = Float.valueOf(rsEmployees.getString("CostValue")).floatValue();
    strFormat = fmtCurrency.format(fltCost);
    txtCost.setText(strFormat);
    lblMessage.setText("");
    catch (SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void actionPerformed(ActionEvent event)
    Object objSource = event.getSource();
    if(objSource == btnAdd && event.getActionCommand()=="Add")
    Add();
    else if(objSource == btnAdd)
    Save();
    else if (objSource == btnEdit)
    Edit();
    else if(objSource == btnDelete)
    Delete();
    else if(objSource == btnCancel)
    Cancel();
    public void setTextToNotEditable()
    txtInvID.setEditable(false);
    txtMan.setEditable(false);
    txtModName.setEditable(false);
    txtYear.setEditable(false);
    txtVID.setEditable(false);
    txtCost.setEditable(false);
    public void setTextToEditable()
    txtInvID.setEditable(true);
    txtMan.setEditable(true);
    txtModName.setEditable(true);
    txtYear.setEditable(true);
    txtVID.setEditable(true);
    txtCost.setEditable(true);
    public void clearTextFields()
    txtInvID.setText("");
    txtMan.setText("");
    txtModName.setText("");
    txtYear.setText("");
    txtVID.setText("");
    txtCost.setText("");
    public void Add()
    lblMessage.setText(" ");
    setTextToEditable();
    clearTextFields();
    txtInvID.requestFocus();
    btnAdd.setLabel("OK");
    btnCancel.setEnabled(true);
    btnDelete.setEnabled(false);
    btnEdit.setEnabled(false);
    public void Save()
    if (txtInvID.getText().length() == 0 || txtModName.getText().length() == 0)
    lblMessage.setText("The Inventory ID or Model Name is blank");
    else
    try
    cmdEmployees.executeUpdate("Insert Into Vehicle"
    + "([InventoryID], [Manufacturer], [ModelName], [Year], [VehicleID], [CostValue])"
    + "Values('"
    + txtInvID.getText() + "', '"
    + txtMan.getText() + "', '"
    + txtModName.getText() + "', '"
    + txtYear.getText() + "', '"
    + txtVID.getText() + "', '"
    + txtCost.getText() + "')");
    lstVehicle.add(txtInvID.getText());
    Cancel();
    catch(SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void Edit()
    int intIndex = lstVehicle.getSelectedIndex();
    if(intIndex == 0 )
    lblMessage.setText("Please select the record to change");
    else
    String strInventoryID = lstVehicle.getSelectedItem();
    try
    cmdEmployees.executeUpdate("Update Vehicle "
    + "Set [InventoryID] = '" + txtInvID.getText() + "', "
    + "[Manufacturer] = '" + txtMan.getText() + "', "
    + "[ModelName] = '" + txtModName.getText() + "', "
    + "[Year] = '" + txtYear.getText() + "', "
    + "[VehicleID] = '" + txtVID.getText() + "', "
    + "[CostValue] = '" + txtCost.getText() + "' "
    + "Where [InventoryID]= '" + strInventoryID + "';");
    if(!strInventoryID.equals(txtInvID.getText()))
    lstVehicle.remove(intIndex);
    lstVehicle.add(txtInvID.getText());
    catch(SQLException error)
    lblMessage.setText("Error during Edit. " + "Error: " + error.toString());
    public void Delete()
    int intIndex = lstVehicle.getSelectedIndex();
    String strInventoryID = lstVehicle.getSelectedItem();
    if(intIndex == 0)
    lblMessage.setText("Please select the record to be deleted");
    else
    try
    cmdEmployees.executeUpdate(
    "Delete from Vehicle where [InventoryID] = '" + strInventoryID + "';");
    clearTextFields();
    lstVehicle.remove(intIndex);
    lblMessage.setText("Record deleted");
    catch(SQLException error)
    lblMessage.setText("Error during Delete." + "Error: " + error.toString());
    public void Cancel()
    btnDelete.setEnabled(true);
    btnEdit.setEnabled(true);
    btnCancel.setEnabled(false);
    btnAdd.setLabel("Add");
    clearTextFields();
    lblMessage.setText("");
    lstVehicle.select(0);
    public void stop()
    try
    if(conEmployees != null)
    conEmployees.close();
    catch(SQLException error)
    lblMessage.setText("Unable to disconnect");
    </code>

    1) Applets that run in web browsers used to be "hip" in at one point in the dark 1990's. That time is forever gone and good riddance. Today big enterprise applications and sophisticated special purpose desktop applications are the Right Way&trade; to go with Java.
    If you want action in your browser, look into Macromedia's Flash technology.
    If you want to deploy your application easily in an applet-like fashion (one click from a browser), look into Java Webstart.
    Demos: http://java.sun.com/products/javawebstart/demos.html
    Documentation: http://java.sun.com/products/javawebstart/developers.html
    2) It's a trivial task to write a launcher applet for any given application so that the applet starts the application in a new window. The security restrictions imposed on applets ("sandbox") might make it impossible to use the application; for instance you cannot write or read files on the local hard drive or make network connections to other servers than where the applet was loaded from. You cannot call System.exit to quit the virtual machine.
    At its simplest the lancher applet code would look ilke:public class Launcher extends java.applet.Applet {
        public void start() {
            YourApplicatioMainClass.main(null);
    }and in the html you would write:<applet code="Launcher" height="1" width="1">
    </applet>See the "Writing applets" tutorial for further information http://java.sun.com/docs/books/tutorial/applet/index.html

  • Cannot get Java to work on XP Pro SP2

    I have just installed Win XP with SP2
    I have installed Sun's Java VM
    Java just does NOT WANT TO WORK!
    I have enabled almost everything to do with Java in the internet options. I just can't get applets to work!
    Does anyone have any ideas? HELP ME PLEASE!
    I am also using ZA Security Suite 5
    Thanks

    I am having the same problem, at least I think so.. When opening a site that uses Java, a popup screen opens that tells me Java virtual machine has to be installed. I lately installed Java Plug-in 1.5.0
    Using JRE version 1.5.0-rc Java HotSpot(TM) Client VM. I have configured everythin that has to do with Java to use this plugin, but it just won�t work. Website is http://www.nl.map24.com/ just fill in any adres to go to the part of the site that uses java. I have opened the java console, but there is no error message coming up there. Also there is no message that IE (6) is accessing JVM, but I don�t know if there has to be one...
    System Windows XP Home with SP1
    Thanks for your reply�s
    Mark Oppedijk
    The Netherlands

  • How do I get an applet to work on a web page?

    I made an applet, but on my computer it only works when I have the JRE installed, and not when it isn't installed. Currently, it doesn't work on the website I put it on unless the computer accessing the website has the JRE installed. Is there any way to get it to work anyways? I know that at least some applets work when I don't have the JRE installed. Why won't mine?

    to run an applet a JRE must be installed. both netscape and IE have default 1.1 compliant jres built in, but you almost certainly don't want to use those, you probably want to use the plugin. to get your applet to use the plugin whether on not it is installed you use a particular html tag. see http://java.sun.com/j2se/1.4.2/docs/guide/plugin/ for details, but briefly you would use something like:
    <html>
    <head>
    <title>IWS Chat</title>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <OBJECT
    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
    WIDTH = 100 HEIGHT = 100 >
    <PARAM NAME = CODE VALUE = "infoworkspace.applet.AnApplet.class" >
    <PARAM NAME = ARCHIVE VALUE = "applet.jar" >
    <PARAM NAME = "type" VALUE = "application/x-java-applet;version=1.4">
    <PARAM NAME = "scriptable" VALUE = "false">
    <COMMENT>
    <EMBED
    type = "application/x-java-applet;version=1.4"
    CODE = "infoworkspace.applet.AnApplet.class"
    ARCHIVE = "applet.jar"
    WIDTH = 100
    HEIGHT = 100
    scriptable = false
    pluginspage = "http://java.sun.com/products/plugin/index.html#download">
    <NOEMBED>
    </NOEMBED>
    </EMBED>
    </COMMENT>
    </OBJECT>
    </body>
    </html>
    this will install the plugin for you and start the applet.
    hope this helps, Mitchell

  • Need help getting my applets to work on web pages!

    I've been trying to get it to work for a while now, and I no idea why it won't work! I've tried all kinds of things to get it to work, but it still won't work. All I want to do is make a simple applet, don't care what it does, and put it on a web page.
    Here is my HTML code:
    <applet code=?Slime2P.class? height=?300? width=?400? codebase=?http://www.spinarcade.com/tests?>
    </APPLET>
    Here is a link to what happens:
    [http://www.spinarcade.com/tests/duk.html|http://www.spinarcade.com/tests/duk.html]
    Here is the errors:
    load: class ?Slime2P.class? not found.
    java.lang.ClassNotFoundException: ?Slime2P.class?
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    It works fine when I run the applet in eclipse, and I've tried many different applets. I tried using a cool program I wanted to put online first, then I made a simple program to try, and then I even downloaded the file from a tutorial and didn't edit it at all... nothing works!
    Here's code from one of the applets (Simple applet with green lines):
    import java.applet.*;
    import java.awt.*;
    public class Duck extends Applet {
    int width, height;
    public void init() {
    width = getSize().width;
    height = getSize().height;
    setBackground( Color.black );
    public void paint( Graphics g ) {
    g.setColor( Color.green );
    for ( int i = 0; i < 10; ++i ) {
    g.drawLine( width, height, i * width / 10, 0 );
    I have all the .class file and the html page in the same place (http://www.spinarcade.com/tests).
    Thank you for your help! It is most likely something simple...
    Edited by: Donv7 on Jul 17, 2008 2:27 PM

    Here is your html:
    <HTML>
    <HEAD>
    <TITLE>Duk!</TITLE>
    </HEAD>
    <body bgcolor="#DAE9F3">
    <center>
    <applet code=?Slime2P.class? height=?300? width=?400?>
    </APPLET>
    ducks these dayz...<br>
    codebase=?http://www.spinarcade.com/tests?<br>
    C:\Documents and Settings\Don\Desktop<br>
    http://www.spinarcade.com/tests<br>
    </center>
    </BODY>
    </HTML>Look carefully at the double quotes surrounding the red text (bgcolor).
    Look at the double quotes used in the applet tag now!!!

  • Java 1.6 Applet on a mac... Can't get it to work

    Hi all,
    I posted this on another section of the forum, but they suggested this would be a better place. Sorry for a duplicate post.
    I am developing a Java 1.6 Applet, and it works fine on Windows and Linux, but I can't seem to get it to work on a Mac.
    I really have little expierence with Macs. I downloaded the newest mac java 1.6. I installed it. I went to the terminal, and verified that it is using java 1.6 (using the java -version command). But then when I load up safari or firefox, the applet will not load. If I open the java applet console, it tells me that it is using a 1.5 jre. I can't seem to be able to change the applet plugin to point to the 1.6 jre.
    Note, that if I go to a terminal, and I run the applet with the 1.6 appletviewer, it works fine. My only issue is getting it to work in the browser on a mac.
    Any ideas?
    Thanks,
    -Adam

    Same problem. Mac 10.5 Firefox 3
    JavaFX 1.0 was just released. I can't get the JavaFX example applets to run with any kind of worthwhile quality -- I have to downgrade the Whole System to 1.5! Results in very low frames per second on the animation examples, and eventual complete freeze up of Firefox. I guess I'll click the giant orange Install Me button on the javafx.com website & see if that gets me any further.
    Sun should implement their JVM and platform support for Apple computers. Current Java system on Mac is a miserable experience.

  • Can't get applet working in Sun Java Studio Enterprise 8

    Hi!
    I'm just learning Sun Java Studio Enterprise 8, and I'm trying to develop and test my first applet within the IDE.
    I have code from a Core Java book that creates a simple applet with buttons and a picture.
    I want to test the applet using the IDE's applet viewer, and then test it through a browser.
    I've followed the instructions I can find in the IDE, but keep getting an error... Class Not Found.
    Does anyone have a simple applet that works within the IDE and instructions for creating and testing an applet within the IDE?
    I know there's sample applet code, but I need to specifically learn how to develop and deploy it within the IDE.
    Thanks.
    Michael O'Neal
    Houston TX USA

    Hi! Thanks for the reply!
    Sorry for the delay in responding here... this is just a "free time" project for me while I"m at work.
    Based on your comment, I've downloaded the "Sun Java Studio Creator 2" IDE, since that sounds like it might be more suited to simple things like applets.
    I'll work with that and I'll post further replies to this thread if I have any questions.
    Thanks for your assistance!

  • I can't get my applet to work in HTML

    I have written an applet that works perfectly OK when I run it at the command line. However, if I try running it from an HTML file it just doesn't work. I get an 'Applet ImageApplet notinited' message in the bar at the bottom of the page. I assume this means that the applets init() method hasn't been called. I find this a bit strange,as I am calling the init() method from my main method.
    The code for the Applet is pasted below. I've also pasted the code from another class (ImageCanvas). The ImageCanvas class is used by my Applet. Please let me know, if you know how to fix this problem. Thanks in advance.
    Craig
    * ImageApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class ImageApplet extends Applet
    ImageCanvas canvas;
    public void init()
         canvas = new ImageCanvas();
         add(canvas);
    public void destroy()
    remove(canvas);
    public void start() { }
    public void stop() { }
    public void processEvent(AWTEvent e)
    if (e.getID() == Event.WINDOW_DESTROY) { System.exit(0); }
    public static void main(String args[])
         Frame frame = new Frame("Image Test");
         ImageApplet     imageApplet = new ImageApplet();
         imageApplet.init();
         imageApplet.start();
         frame.add(imageApplet);
         frame.setSize(160, 140);
         frame.setResizable(false);
         frame.show();
    * ImageCanvas.java
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    class ImageCanvas extends Canvas
    BufferedImage image;
    public ImageCanvas()
         try { image = ImageIO.read(new File("images/image0.jpg")); }
         catch (IOException e) { }
    public void paint(Graphics g) { g.drawImage(image, 0, 0, null); }
    public Dimension getPreferredSize()
    if (image == null)
    return new Dimension(100, 100);
         else
         return new Dimension(image.getWidth(null), image.getHeight(null));
    }

    since your code burns my eyes without formatting:
    * ImageApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class ImageApplet extends Applet
    ImageCanvas canvas;
    public void init()
    canvas = new ImageCanvas();
    add(canvas);
    public void destroy()
    remove(canvas);
    public void start() { }
    public void stop() { }
    public void processEvent(AWTEvent e)
    if (e.getID() == Event.WINDOW_DESTROY) { System.exit(0); }
    public static void main(String args[])
    Frame frame = new Frame("Image Test");
    ImageApplet imageApplet = new ImageApplet();
    imageApplet.init();
    imageApplet.start();
    frame.add(imageApplet);
    frame.setSize(160, 140);
    frame.setResizable(false);
    frame.show();
    * ImageCanvas.java
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    class ImageCanvas extends Canvas
    BufferedImage image;
    public ImageCanvas()
    try { image = ImageIO.read(new File("images/image0.jpg")); }
    catch (IOException e) { }
    public void paint(Graphics g) { g.drawImage(image, 0, 0, null); }
    public Dimension getPreferredSize()
    if (image == null)
    return new Dimension(100, 100);
    else
    return new Dimension(image.getWidth(null), image.getHeight(null));
    }I didn't want to answer your question yet, but I at least wanted to read the code without going blind. Please use the code brackets when you post code in the future.

  • Problem Getting An Applet To Work

    Hi,
    I hope there is someone out there that can help me with this problem.
    I'm trying to get an applet to work inside of IE6 and I'm getting the following error message via Java Console,
    Error loading class: demo
    java.lang.ClassFormatError
    java.lang.ClassNotFoundException: demo
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    The java code is as follows,
    import java.applet.*;
    import java.awt.*;
    public class demo extends Applet {
    public void init() {
    public void paint(Graphics g) {
    g.drawString("Hello World", 50, 50);
    And the html (demo.htm) is
    <html>
    <head>
    </head>
    <body bgcolor="#00DCFF">
    <applet name="demo" code="demo.class" width="300" height="200">
    </applet>
    </body>
    </html>
    Both demo.htm and demo.class are both in the same directory. I used the Sun Java SDK version 1.4.1 to produce the class.
    I can get it to work if I enable
    Java (Sun)
    Use Java 2 v1.4.1 for applet
    within the Advanced options of IE6, but I don't want to have to force the user to have to either load the the SDK or the plug-in (by using OBJECT/EMBED) due to their size.
    thanks in advance,
    Wayne

    >
    Error loading class: demo
    java.lang.ClassFormatError
    java.lang.ClassNotFoundException: demoIf you load it into Netscape it'll work fine - I cant see any errors with ur code. Have u tried it in the appletviewer?

  • Please Help! Can't get my applet to work!!

    PLEASE HELP
    I have been trying to get an applet to work which when viewed in an applet viewer works fine.
    HOWEVER, when I try to view it through the browser it will not be viewed. The html code I've used is very simple and you can see that below . I've downloaded the JAVA plugin but that doesn't work either!
    The errors that come up say --- java.lang.ClassFormatError.Class already loaded
    Then if the window is expanded says --- java.lang.NoClassDefFoundError:javax/swing/JApplet
    I haven't a clue what's wrong!!
    HTML CODE
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
    <HTML>
    <HEAD><TITLE>Chess Game
    </TITLE>
    </HEAD>
    <BODY>
    <applet Code ="ChessClient20.class" Width =450 Height =555>
    </applet>
    </BODY>
    </html>
    Thanks for any help!!

    Thanks, have now found original mail. I think I've lost the plot. will check out those suggestions.

  • Problems getting an applet to work on i-net

    i tried to load my (in browser working applet) on my
    net account. after loading most of the image resources i get.
    java.util.zip.ZipException: invalid stored block lengths
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:225)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:283)
    at java.io.DataInputStream.readFully(DataInputStream.java:213)
    at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.jav a:1174)
    at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.ja va:1278)
    at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java :1364)
    at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1532 )
    at javax.imageio.ImageIO.read(ImageIO.java:1317)
    at javax.imageio.ImageIO.read(ImageIO.java:1283)
    at ImageLoader.<init>(ImageLoader.java:69)
    at Memory.init(Memory.java:45)
    at sun.applet.AppletPanel.run(AppletPanel.java:344)
    at java.lang.Thread.run(Thread.java:539)
    An image file could not be read: 
    javax.imageio.IIOException: Error reading PNG image data
    java.lang.IndexOutOfBoundsException: Index: 39, Size: 37
    at java.util.ArrayList.RangeCheck(ArrayList.java:503)
    at java.util.ArrayList.get(ArrayList.java:315)
    at ImageLoader.getStrip(ImageLoader.java:217)
    at HighScoreMenu.<init>(HighScoreMenu.java:20)
    at Memory.init(Memory.java:46)
    at sun.applet.AppletPanel.run(AppletPanel.java:344)
    at java.lang.Thread.run(Thread.java:539) * the line "ImageLoader 69" is : img = ImageIO.read(getClass().getResource("tiles/drehung.png"));* ImageLoader.getStrip() would only return an animationstrip created on base of the loaded images.
    because it throws an indexoutofboundexception i assume that the images arent loaded properly
    the applet isnt packed in a jar. all images are tested on the server, all applet files are properly transferred.
    then i wrote a little applet which does nothing more than displaying an image usinf ImageIO.read same way i use it in my target-applet. all works fine.
    i have no clue ...

    Use the method getDocumentBase() (or getCodeBase()) from Applet-Class to find out where exactly is your Applet located and then add "tiles/drehung.png" to it.

  • Applet Not Working in Browser

    I built a java applet that works fine in the applet viewer, but just appears as a gray screen in a web browser. In the status bar of the web browser, it says that the applet has been started. The only possible cause of this that I can think of is a failure to connect to the internet. The program should appear like that if it fails to connect to the internet when it first starts. If this is the problem, please see my other post about making that work.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=449444&tstart=0&trange=15

    1) What Browser?
    2) What is you code?
    1) If it is Internet Explorer, the problem would be an outdated JVM. MS JVM only supports up to Java 1.1.8 so you would have to rework your Applet to fit with just those classes/methods present at that time (ie no Swing, and check the APIs to make sure that the since version isn't past 1.1.
    If you are using other browsers, the old JVM may be a problem as well. It should be easy enough to install the latest one.
    2) Start out with something simple, like a hello world. Get that to work, then worry about the more complicated stuff.

  • Applet not working in browser, works with appletviewer

    Hi,
    I'm trying to use an Applet program from the tutorials which keeps on displaying time in the HTML page:
    import java.awt.Graphics;
    import java.util.*;
    import java.text.DateFormat;
    import java.applet.Applet;
    public class home_page extends Applet implements Runnable {
        private Thread clockThread = null;
        public void init()
        public void start() {
            if (clockThread == null) {
                clockThread = new Thread(this, "Clock");
                clockThread.start();
        public void run() {
            Thread myThread = Thread.currentThread();
            while (clockThread == myThread) {
                repaint();
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e){
                // the VM doesn't want us to sleep anymore,
                // so get back to work
        public void paint(Graphics g) {
            // get the time and convert it to a date
            Calendar cal = Calendar.getInstance();
            Date date = cal.getTime();
            // format it and display it
            DateFormat dateFormatter = DateFormat.getTimeInstance();
            g.drawString(dateFormatter.format(date), 5, 20);
        // overrides Applet's stop method, not Thread's
        public void stop() {
            clockThread = null;
    }When i use this program in the browser, i cannot see the clock but i'm able to see only a gray box. I'm using the applet tag within the HTML page.
    I can see the same compiled applet running successfully with appletviewer program.
    Please help me out of this predicament.
    -Manish

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

Maybe you are looking for

  • Admins reply After 48+ Hours of Ag

    ?After reading about tia_dear thread about her mp3 problems and myslef adding to my problems about the visionm ,We now get an a Administrator also adding to tia_dears?thread . Catherina -cl says?( Sorry to hear you were having problems with your Crea

  • [SOLVED] gnome 3 look and feel

    Hello all, I did a fresh install of arch and gnome 3 last night.  I am currently running on fallback mode, prefer that mode to the new interface.  The question I have is, is it possible to easily customize/theme Gnome 3 Fallback in Arch to change som

  • Question on How to Use NHI Difference Report

    Hi, We are trying to figure out how to make the Transaction Code PC00_M42_LHID (NHI Difference Report) work. What file type (.xls, .txt, etc) should be used in the Comparison Filemane field?  Anyone who is familiar with the transaction, please help.

  • Material Issue against multiple reservation in one step

    Hello everybody, I want to issue materials against multiple reservation (originating from Service order or PM order) in one step because the number of reservations is quite large (say thousands of reservation in a day). If i go one by one through MB1

  • StringIndexOutOfBoundsException using ARRAY data type

    Hi all. JDK 1.5.0_03, Oracle 9.2.0.4, 9i thin drivers. I'm trying to use the ARRAY data type to submit a large amount of data to a stored procedure. Unfortunatley I'm getting an error when using the oracleCAllableStatement.setArray method. I've succe