Swing based applets don't run in browser !!!

whenever i run a swing based applet from the browser (IE 5), the applet is not displayed in it - status bar shows that the class file was not found
so please tell me the solution
thanx in advance!

You just have to download Sun JVM to run swing JApplet in your browser(IE).
get it at the following address:
Just follow the link, and download dialog will be appeared just save the file to you hard drive, and install the software.
The file name will be : "j2re-1_4_1_02-windows-i586-i.exe"
http://java.sun.com/webapps/download/AutoDL?BundleId=7544
after successfull installation you'll find the new plugin
"java2 v1.4.1_02 for<applets>"
in Tools>InternetOptions>Advance
you have to check it(if unchecked) to enable the JApplet to be loaded in your browser.
Another new option you'll find in your Tools menu "Sun Java Console". From it you can find what exceptions are thrown while the applet is loaded

Similar Messages

  • Running the Swing based applet in html

    Hi
    I am getting problem while runing a swing based applet in html. If i am using eclips and run my file as java applet it is working fine.
    For testing purpose, my html and all jars are in the same folder where my applet class is reside.
    Also i am not getting any error in html..
    Please help

    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

  • Java 1.1.5 applets don't run in Netscape 6.1/6.2

    I try to access a website with java-applets.
    With Netscape 4.7x it's no problem. Java-Console says "Java 1.1.5". No java-plugin's installed.
    With IE 5.x and 6 no problem.
    Java Virtual Machine Build 3234 is installad
    Systems NT4.0 and Win2000
    With Netscape 6.1 and 6.2 those applets don't run (there is only a grey-area open where the applet should build up the content). I've seen there are couple of java-plugin's loaded in the Netscape 6 (NPOJI600.dll, NPJava130_01.dll, NPJava130_01a.dll, NPJava130_01b.dll and NPJava130_01c). As an idea I temporarly deleted them in the hope it would use JVM, as I suppose happens in Netscape 4.7x, were no java-plugin's are installed. But unfortunately it doesn't work either. It looks like Netscape 6.x can not refer to those java-components that the Netscape 4.7x uses.
    Can I get somewhere the missing old plugin (1.1.5) or is there another way to make it work?
    My search in java.sun.com told me that there seems to be no java 1.1.5 at all, so how can
    Netscape talk about 1.1.5?
    Thanks for any help....
    Peter
    PS) I have no experience in Java at all.

    Hello,
    If you look at the release notes of Netscape they mention that Netscape 6.x will not run Java codes unless there 1.3.0_01 and above
    Sometime you wonder where they get these ideas, that means that if you have an old applet it won't run with the new browser. I guess they never heard about backward compatibility
    Yanick

  • Swing based applet communication with javascript

    Hi
    In my browser based application, the GUI has two part one contains the swing based applet and other is html based text area. Applet contains the list of text files.
    My requirements is that if user double clicks on a file the, text area should display the name or path or content of file. I facing problem at very first level, how to capture the swing event in java script of browser?
    Thanks in advance!!! :)

    Hi
    In my browser based application, the GUI has two part one contains the swing based applet and other is html based text area. Applet contains the list of text files.
    My requirements is that if user double clicks on a file the, text area should display the name or path or content of file. I facing problem at very first level, how to capture the swing event in java script of browser?
    Thanks in advance!!! :)

  • Applet can not run in browser, but it wroks in appetviewer. Why?

    I wrote a very simple applet, and it works well when I use appletviewer. But when I use browser to open the html file which contains the applet, it always gives no class found error. My browsers are IE5.0 and Netscape4.77. Hwo can I make the applet run in browser?
    Quick response is greatly appreciated.

    see you have to put the proper code base in your html file.check if your browser is java enabled or not.Java plugin comes with IE 5 and it automatically get installed if you won't disagree with that.Check in optin menu of ur browser that java is enabled or not.
    Applet works fine with all browser.
    2nd thing when you r running applet through appletviewer,it runs as an application from your local JVM while running through browser means you are running applet through browser 's JVM.

  • Applet was not running in Browser

    I have wriiten one applet (using JMF for playing a song)program and it was run in appletviewer it's work perfectly.After that i was open this prog in browser it doen't work ,it gives following error :
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         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)
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         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)Any one help me,becaz past 4 days i have getting this error ,so i cann't move further any steps on my module ,so any one help me.
    Advance Thankx & Regards
    K.suresh

    Hai Manu
    I am using u r code,and change my applet tag like
    <APPLET CODE="SimplePlayerApplet.class" WIDTH = "300" HEIGHT = "300" ></XMP>
    <PARAM NAME ="FILE" VALUE = "artist - Track 01.mp3" >
    </APPLET>Now i am getting error as:
    APPLET tag missing CODE parameter.
    java.lang.NullPointerException: name
         at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
         at sun.applet.AppletPanel$6.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         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)
    the applet program below there
    import java.applet.Applet;
    import java.awt.*;
    import java.io.IOException;
    import java.io.PrintStream;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.media.*;
    public class SimplePlayerApplet extends Applet
        implements ControllerListener
        public SimplePlayerApplet()
            player = null;
            visualComponent = null;
            controlComponent = null;
            progressBar = null;
            firstTime = true;
            CachingSize = 0L;
            panel = null;
            controlPanelHeight = 0;
            videoWidth = 0;
            videoHeight = 0;
            System.out.println("Hai");
    public void init()
            setLayout(null);
            setBackground(Color.white);
            panel = new Panel();
            panel.setLayout(null);
            add(panel);
            panel.setBounds(0, 0, 320, 240);
            String s = null;
            MediaLocator medialocator = null;
            Object obj = null;
            System.out.println("IT's from Init");
            System.out.println("S value is:" + s);
            if ((s = getParameter("FILE")) == null)
                 System.out.println("S value is:NULL");
                Fatal("Invalid media file parameter");
            try
                URL url = new URL(getDocumentBase(), s);
                System.out.println("URL Value is:" + url);
                s = url.toExternalForm();
            catch(MalformedURLException malformedurlexception) { }
            try
                if((medialocator = new MediaLocator("file:" + s)) == null)
                    Fatal("Can't build URL for " + s);
                    System.out.println("catch in malformed");
                try
                    player = Manager.createPlayer(medialocator);
                    System.out.println("it is from create player");
                catch(NoPlayerException noplayerexception)
                    System.out.println(noplayerexception);
                    Fatal("Could not create player for " + medialocator);
                player.addControllerListener(this);
                System.out.println("player add control");
            catch(MalformedURLException malformedurlexception1)
                Fatal("Invalid media file URL!");
            catch(IOException ioexception)
                Fatal("IO exception creating player for " + medialocator);
        public void start()
            if(player != null)
                player.start();
                System.out.println("This from start");
        public void stop()
            if(player != null)
                   System.out.println("This from stop");
                player.stop();
                player.deallocate();
        public void destroy()
            player.close();
            System.out.println("This from Destory");
        public synchronized void controllerUpdate(ControllerEvent controllerevent)
              System.out.println("This from cotrollerUpdate");
            if(player == null)
                return;
            if(controllerevent instanceof RealizeCompleteEvent)
                if(progressBar != null)
                    panel.remove(progressBar);
                    progressBar = null;
                int i = 320;
                int j = 0;
                if(controlComponent == null && (controlComponent = player.getControlPanelComponent()) != null)
                    controlPanelHeight = controlComponent.getPreferredSize().height;
                    panel.add(controlComponent);
                    j += controlPanelHeight;
                if(visualComponent == null && (visualComponent = player.getVisualComponent()) != null)
                    panel.add(visualComponent);
                    Dimension dimension = visualComponent.getPreferredSize();
                    videoWidth = dimension.width;
                    videoHeight = dimension.height;
                    i = videoWidth;
                    j += videoHeight;
                    visualComponent.setBounds(0, 0, videoWidth, videoHeight);
                panel.setBounds(0, 0, i, j);
                if(controlComponent != null)
                    controlComponent.setBounds(0, videoHeight, i, controlPanelHeight);
                    controlComponent.invalidate();
            } else
            if(controllerevent instanceof CachingControlEvent)
                if(player.getState() > 200)
                    return;
                CachingControlEvent cachingcontrolevent = (CachingControlEvent)controllerevent;
                CachingControl cachingcontrol = cachingcontrolevent.getCachingControl();
                if(progressBar == null && (progressBar = cachingcontrol.getControlComponent()) != null)
                    panel.add(progressBar);
                    panel.setSize(progressBar.getPreferredSize());
                    validate();
            } else
            if(controllerevent instanceof EndOfMediaEvent)
                player.setMediaTime(new Time(0L));
                player.start();
            } else
            if(controllerevent instanceof ControllerErrorEvent)
                player = null;
                Fatal(((ControllerErrorEvent)controllerevent).getMessage());
            } else
            if(controllerevent instanceof ControllerClosedEvent)
                panel.removeAll();
        void Fatal(String s)
            System.err.println("FATAL ERROR: " + s);
            throw new Error(s);
        Player player;
        Component visualComponent;
        Component controlComponent;
        Component progressBar;
        boolean firstTime;
        long CachingSize;
        Panel panel;
        int controlPanelHeight;
        int videoWidth;
        int videoHeight;
    }

  • Applet does not run in Browser

    Iam using Windows XP and IE 6.0. Applets do not run in my browser. Hovering the cursor where the applet should be in the browser, I get a Class not found message. Setting the CLASSPATH variable did not help. Any suggestions?

    You might find an answer in this new page
    [url http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/index.html]Java Upgrade Guide: Migrating From the Microsoft JVM to the Sun JRE

  • Applet won't run in browser

    I created an applet that writes and reads from a text file. It works when I run it in eclipse but not in a browser.
    Noob

    By default applets can't read the local filesystem. Presumably Eclipse lets you do it to make development easier. If you want your applet to read the local filesystem, you apparently have to sign it.

  • Applets don't  run

    i write a program with applets but i coundn't run it. it gives an error " Exception in thread "main" java.lang.NoClassDefFoundError: welcomeApplet2 " why? i also write its html page

    i write a program with applets but i coundn't run it.
    it gives an error " Exception in thread "main"
    java.lang.NoClassDefFoundError: welcomeApplet2 " why?
    i also write its html pageThat sounds like you have some errors in your html page. What does it look like? (Do only post the applet part)
    Kaj

  • Applet embedded in JSP doesn't run on browser with older than JRE-1.6

    I have embeded an Applet in my JSP Page which used JDK1.6's getHardwareAddress() method to get user's physical address.
    I have embeeded this into a JAR file and used it in my JSP where this applet run on onload() event of the form --> runs the applet --> and gets physical address of user machine and prints it in one of the text boxes on the form.
    Now, the issue is that the applet doesn't run on browser that doesn't support JRE 1.6
    My concern is that how can I run this (if at all possible) in browsers that support lower versions of JRE or is it possible to check that if the browser doesn't support JRE 1.6 then load the basic version of form without running the applet. Can i actually check the version of browser JRE somehow and stop to execute the applet. Because what happens as of now is that if the applet doesn't execute, the complete form fails to load.
    The last option is that I give a message on my web page that redirects user to Sun Java site and asks them to update their browsers.

    Personally, I have no knowledge about Applet but have you checked this link?
    [http://blogs.sun.com/thejavatutorials/entry/deployment_toolkit_101|http://blogs.sun.com/thejavatutorials/entry/deployment_toolkit_101]

  • Applets which don't run

    Hello,
    I have any applets which run with Appletviewer or the development tool "Forte for Java" but they don't run on the web browser whereas I have others applets (with almost the same code) which run in the both cases.
    In fact, on the web browser, you can see the static components (buttons, choices...) but these ones have no effects.
    And, the access to the database seems not to run.
    I think it's an problem which doesn't come from the code but I don't know what.
    Can you help me ?
    Thank you.

    Browsers have in-built support for JDK 1.1 If you are using packages not suported by JDK1.1 for example Swing, the applets won't work without downloading a plugin. The first thing you should do is check if you are using packages not suported by the JDK1.1 Also check if your browser does use a plugin.
    You can download the plugin from this site:
    http://java.sun.com/getjava/download.html
    When you are downloading the plugin you can specify that it is used by your browser by default. This means that you do not have to modify your HTML file.
    The following is relevant if you intend to put your applet up on the web:
    The user may not have their browser set up to automatically use a plugin. This means that you may need to convert your HTML file so that the plugin is used to run the applet and it works corrrectly for different browsers. Also if the user does not have the correct plugin your web page prompts them to download it.
    This site explains how the HTML code is modified:
    http://java.sun.com/products/plugin/1.2/docs/tags.html
    There is a way to do this conversion process automatically - by using the HTMLConverter in the bin directory of your JDK. The following site gives directions on how to use it:
    http://java.sun.com/products/plugin/1.3/docs/htmlconv_01.html
    If you are putting the applet up on the web maybe you should consider rewriting it so that it only uses packages supported by the JDK1.1 That way the user will automatically be able to view the applet without downloading any plugin and you will not need to convert the HTML file.
    I hope this helps,
    RC

  • How to run a swing based client server application in web?

    hi ,
    wat hav 2 do to run a swing based client server application in web?

    Swing applications run on the client only. You have two basic options:
    1) turn the app into an applet so it can run inside the browser (but still on the client)
    2) use webstart to allow the swing application to automatically install on the client from your server.

  • Applet not running in browser?

    Hi
    What is the reason why an applet will be running in appletviewer but not in a browser???

    Hi,
    Try out with this html file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    <title>Example</title>
    <script language="JavaScript">
    function MyToolBar()
    window.open("Login.html","LoginPage","toolbar=0,menubar=0,scrollbar=0,resizable=0,directories=0,width='110%',height='150%'");
    </script>
    </head>
    <body>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) | | (info.indexOf("Sun") > 0) | | (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "150%" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" ></XMP>
    <PARAM NAME = CODE VALUE = "MyApplet.class" >
    </APPLET>
    </NOEMBED></EMBED></OBJECT></Center>
    <!--
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" >
    </APPLET>
    -->
    </body>
    </html>
    Hope this will help you.
    Anil
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Swing applets don't display

    I'm having no success getting my applets that use swing components to display in my web browser. I've read some forum posts about similar problems and they all talk about downloading the JRE. I already have the latest version and no change. I'm led to belive it is because some browsers do not support Java 1.3 but this can be overcome by using a JAR archive. I'm not familiar with this. How do I get my applets to show?
    Thanks in advance

    All you have to do is put your HTML file thru the HTMLConverter by typing:
    HTMLConverter test.htm
    where test.htm is the name of your HTML file which should contain an <APPLET> tag like this:
    <APPLET CODE="MyApplet" CODEBASE="." WIDTH=200 HEIGHT=100></APPLET>
    Note that the above is just a sample with bare minimum for an applet. Note also that the HTMLConverter should come with your JDK1.3 but if you can't find it on your system, you may have to download it from Sun's web site.
    V.V.

  • Applet running in IDE's applet viewer but not within browser

    Hello,
    I have this applet which runs perfectly on JBuilder4's Applet viewer but when I access the HTML file which JBuilder generated as part of the applet creation the applet won't run.
    The parameters in the applet tag in the HTML file are correct, i.e. the code attribute of this tag has as its value the correct class that implements the applet.
    The only io operations associated with the applet are writing/reading objects to the socket's input/output stream, to communicate with a threaded server which has been started before running the applet. It all runs on the local host. So, I'm not sure it should be signed for it to run in the browser, should it?
    I have tried several browsers, and have the latest java plug-in installed.
    Any comments on this?

    Check this link which might be helpful:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=126261

Maybe you are looking for