Java Applet Won't Initialize

This is a modified version of a tutorial I've been working with. Code for Main.java:
import javax.swing.*;
public class Main {       
* @param args the command line arguments
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("Swing Paint Demo");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300,300);
f.setVisible(true);
Problem is that when I try to load the applet into an html file:
<html>
<APPLET code="Main.class"></APPLET>
</html>
It doesn't load.
The file compiles and executes as a stand alone .jar, but when I try to run it as an applet it won't work.
I know I'm probably missing an easy step. I have already checked my IE7 settings and java is enabled. I have no problem with any other java applets, just the ones I make. haha. Thank you ahead of time.

I did some research, and got a new tutorial because the old one was inappropriate like you pointed out previously. This one I copy pasted into my editor, it compiled fine. I run it through my browser and it doesn't work still. Same issue, coincidentally, what do you make of it?import javax.swing.JApplet;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
//Since we're adding a Swing component, we now need to
//extend JApplet. We need to be careful to access
//components only on the event-dispatching thread.
public class Main extends JApplet {
    JTextField field;
    public void init() {
        //Execute a job on the event-dispatching thread:
        //creating this applet's GUI.
        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    createGUI();
        } catch (Exception e) {
            System.err.println("createGUI didn't successfully complete");
        addItem(false, "initializing... ");
    private void createGUI() {       
        //Create the text field and make it uneditable.
        field = new JTextField();
        field.setEditable(false);
        //Set the layout manager so that the text field will be
        //as wide as possible.
        setLayout(new java.awt.GridLayout(1,0));
        //Add the text field to the applet.
        add(field);
    public void start() {
        addItem(false, "starting... ");
    public void stop() {
        addItem(false, "stopping... ");
    public void destroy() {
        addItem(false, "preparing for unloading...");
        cleanUp();
    private void cleanUp() {
        //Execute a job on the event-dispatching thread:
        //taking the text field out of this applet.
        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    remove(field);
        } catch (Exception e) {
            System.err.println("cleanUp didn't successfully complete");
        field = null;
    private void addItem(boolean alreadyInEDT, String newWord) {
        if (alreadyInEDT) {
            addItem(newWord);
        } else {
            final String word = newWord;
            //Execute a job on the event-dispatching thread:
            //invoking addItem(newWord).
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        addItem(word);
            } catch (Exception e) {
                System.err.println("addItem didn't successfully complete");
    //Invoke this method ONLY from the event-dispatching thread.
    private void addItem(String newWord) {
        String t = field.getText();
        System.out.println(newWord);
        field.setText(t + newWord);
}

Similar Messages

  • Why applet won't initialize

    I had the following applet running but I changed some of the code around
    . Now that I deleted whatever I was working on, the applet won't initialize. Where is the problem in the code:
    import javax.swing.*;
    import java.awt.Graphics;
    public class ClassAverageApplet extends JApplet
         String first,second, third, fourth,fifth, name, className;
          double a,b,c,d,e,f, sum;
        public void init() 
         String first,second, third, fourth,fifth, name, className;
          double a,b,c,d,e,f, sum;
          name = JOptionPane.showInputDialog("Student's name please");
          first = JOptionPane.showInputDialog("Please enter first Grade");
          a = Double.parseDouble(first);
          second = JOptionPane.showInputDialog("please enter second Grade");
          b = Double.parseDouble(second);
          third = JOptionPane.showInputDialog("please enter Third Grade");
          c = Double.parseDouble(third);
          fourth = JOptionPane.showInputDialog("please enter Fourth Grade");
          d = Double.parseDouble(fourth);
          fifth= JOptionPane.showInputDialog("please enter Fifth Grade");
          e = Double.parseDouble(fifth);
          f = (a + b + c + d + e)/5;
          sum = a + b + c + d + e;
       public void paint(Graphics g)
           g.drawRect(15,10,300,150);
    if(f  > 89)
      g.drawString("Student:    " + name,25,25);
      g.drawLine(25,25,70,25);
      g.drawString("Class:      " + name,25,40);
      g.drawLine(25,40,60,40);
      g.drawString("Your final grade is an A ",25,50);
      g.drawString("The sum of your grades out of 500 points is " + sum ,25,60);
      g.drawString("The grade average is " + f,25,70);
      g.drawString("Here are your grades for the class",70,90);
      g.drawLine(70,90,255,90);
      g.drawString("First Grade:    " + a,25,110);
      g.drawLine(25,110,90,110);
      g.drawString("Second Grade:   " + b ,25,120);
      g.drawLine(25,120,90,120);
      g.drawString("Third Grade:    " + c,25,130);
      g.drawLine(25,130,90,130);
      g.drawString("Fourth Grade:   " + d ,25,140);
      g.drawLine(25,140,90,140);
      g.drawString("Fifth Grade:    " + e,25,150);
      g.drawLine(25,150,90,150);
    }Thanks for your help.

    Hi mdiamond1,
    Your code worked for me on a Windows 98 machine with Micro$oft Internet Explorer 6 with the java plug-in version 1.4.1_01.
    Perhaps you can supply some more details about your environment and the exact error message and stack trace you are getting?
    Cheers,
    Avi.

  • Java applets won't run on Safari???

    I have reinstalled Java twice, and it still won't run any Java applets. It just sits there with the cup logo and the arrow on either side. It works fine on Firefox but not Safari. Help?

    Hello
    I'm piggy backing on this thread because I too have had problems with Java and Safari
    Java runs fine for me in Firefox, however.
    I went to a federal website
    https://blrscr3.egs-seg.gc.ca/gol-ged/gov/browserdetection/BrowserCheck.html
    that uses java and received this message
    " Java applet unable to load
    To use this service, you must either install a recent version of the Sun JVM or enable "Scripting of Java applets" if it has been disabled."
    so i looked for an update and have downloaded and installed release 6, (at least, it said that it was installed, but have never been able to figure out where)
    when I check Java preferences, the choices are J2SE 1.4.2 or J2SE 5, and when I've switched to 1.4.2 I still have no luck.
    When i run firefox, i get the java console opening, but it doesn't open with safari, and I can't find the option for this to turn on in safari
    i have restarted both safari and my computer and no luck. I have repaired permissions and no changes have taken place.
    Any more suggestions?
    (thank you, by the way)

  • Java applets won't load, have latest version of java installed, have removed all old versions from the hard drive, java console not working in firefox, any suggestions please ?

    java applets will not load,
    i have run the java test page & i have the latest version installed.
    have removed all old versions of java from my hard drive & restarted the computer.
    i have checked that java is enabled in the plug-ins and it is with version se 6 u22, also something called java development toolkit 6.0.220.4 np runtime script plug-in library for java (tm) deploy.
    if i click on java console in tolls nothing happens

    Hi,
    You might want to look in your control panel for 'Java' icon. It should give you an option to enable java plugin into your browser. Let me know if you still face the issue.
    Thanks!

  • Java applet won't load on browser

    God, I've never been this frustrated with Java before.
    Ok, I created an applet in my eclipse IDE and ran it. It works. I decided to create a HTML file so that the applet would display on my firefox browser (my browser has no problem displaying java applets. All settings are fine).
    This is my HTML code:
    <html>
    <title>Site Selector</title>
    <body>
       <applet code = "SiteTesting.class" width = "300" height = "75">
       </applet>
    </body>
    </html>Now, my eclipse IDE creates a "src" or source folder and a bin folder. The bin folder is where the class files are kept. The HTML file was in the src folder. When I ran it, I got this:
    load: class SiteTesting.class not found.
    java.lang.ClassNotFoundException: SiteTesting.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: F:\Workspace\RefreshalCourse\src\networking\SiteTesting\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 9 more
    Exception: java.lang.ClassNotFoundException: SiteTesting.classMakes sense, considering the class file isn't in the src folder. So I copied the class files into the src folder, ran the HTML file, and I got this:
    java.lang.NoClassDefFoundError: SiteTesting (wrong name: networking/SiteTesting)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.NoClassDefFoundError: SiteTesting (wrong name: networking/SiteTesting)Huh. I took the html file and placed it in the bin folder where the class file was and I ran it and got the exact same error message above.
    I'm obviously doing something wrong. So, any help in fixing this will be most appreciated. Cheers

    Your java file starts with:
    package networking;Right?
    If so, the fully qualified name name of your class is networking.SiteTesting.
    Use this in the applet tag:
    <applet code = "networking.SiteTesting" width = "300" height = "75">Suppose you have your html file in the directory zzz.
    Put SiteTesting.class in zzz/networking/, like this:
    zzz/whatever.html
    zzz/networking/SiteTesting.class

  • Applet won't initialize

    Hi,
    I've been trying to get an applet to run for a while, but I get a blank screen and it says Applet not initialized whenver I try to run it. The applet works fine in Eclipse but I get this problem when I use JCreator or a browser. Can anyone help me find the problem?
    Thanks in advance.
    import java.awt.*;
    import java.io.*;
    import java.applet.Applet;
    import java.util.Random;
    public class MoveCrayons extends Applet
        private final int APPLET_WIDTH = 400;
        private final int APPLET_HEIGHT = 500;   
        private Crayon crayon1, crayon2, crayon3, crayon4, crayon5, crayon6;
       public void init ()
          Random gen = new Random();
           crayon1 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
           crayon2 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
           crayon3 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
           crayon4 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
           crayon5 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
           crayon6 = new Crayon(gen.nextInt(20) + 30, 25, new Color(gen.nextInt(256), gen.nextInt(256), gen.nextInt(256)), 1);
          setBackground (Color.white);
          setSize (APPLET_WIDTH, APPLET_HEIGHT);
       public void paint (Graphics g)
              Thread thread = new Thread();
              for(int i = 0; i < 200; i++)
                        try
                             thread.sleep(30);
                             g.clearRect(0, 0, APPLET_WIDTH, APPLET_HEIGHT);
                             crayon1.move(g, 20);
                             crayon2.move(g, 20);
                             crayon3.move(g, 20);     
                             crayon4.move(g, 20);     
                             crayon5.move(g, 20);
                             crayon6.move(g, 20);
                             g.setColor(Color.yellow);
                        g.fillRect(20, 100, 220, 250);
                        g.setColor(Color.black);
                        g.drawRect(20, 100, 220, 250);                      
                       catch(InterruptedException e)
    }

    My immediate guess is that your HTML isn't set up correctly, so the browser can't find Crayon.class. Have a look at the Java console: does it have an exception stack trace?

  • Java Applets won't load in Netscape 4

    Hello,
    No java applets will load in Netscape 4. I checked to see if java plugins existed and they do I actually have about 4 different versions installed on my computer because I have been trying to resolve this issue. I looked in the browsers plugins directory it contains four java .dll files. Does anybody know whats going on? In internet explorer java applets load correctly.
    Thank You,
    Mark

    Perhaps it is due to your HTML code in the webpage? If you use the <APPLET> tag only, the applet may not run in all browser/platform. You can use HtmlConverter that comes with JDK/JRE 1.4 in order to generate HTML code which allows your applet to run in any browser/platform.
    Hope it helps,
    A.A.
    Hello,
    No java applets will load in Netscape 4. I checked to
    see if java plugins existed and they do I actually
    have about 4 different versions installed on my
    computer because I have been trying to resolve this
    issue. I looked in the browsers plugins directory it
    contains four java .dll files. Does anybody know whats
    going on? In internet explorer java applets load
    correctly.
    Thank You,
    Mark

  • Java Applet won't load when a JavaScript variable "this.Document" is used.

    Hi,
    Creating a "this.Document" variable within JavaScript interferes with some versions of Java. So far it breaks on the following versions, using IE7 on Windows XP:
    * JRE 6.0 Update 7
    * JRE 6.0 Update 6
    * JRE 6.0 Update 5
    * JRE 6.0 Update 4
    [Due to time constraints JRE 6.0 to JRE 6.0 Update 3 were not tested]
    * JRE 5.0 Update 22
    [Due to time constraints JRE 5.0 Update 16 to JRE 5.0 Update 21 were not tested]
    * JRE 5.0 Update 15
    [Due to time constraints JRE 5.0 Update 1 to JRE 5.0 Update 14 were not tested]
    * JRE 5.0
    The following HTML demonstrates this problem when you have any of the above versions of Java installed:
    <html>
        <head>
            <title>Java Bug</title>
            <script type="text/javascript" language="javascript">
                this.Document = 'string'; // Remove this line to get it to work again
            </script>
        </head>
        <body style="background-color:black">
            <applet id="testVM" alt="Something is wrong. Java is not working."
                codebase="http://www.java.com/applet" code="testJava2_1/TestVMApplet"
                archive="TestVM2-test.jar" width="500" height="280">
                <param name="locale" value="en" />   
                <param name="titleSize" value="22" />
                <param name="subtitleSize" value="18" />   
            </applet>
        </body>
    </html>The page only displays a white box where the Java Applet should be. If you then remove the "this.Document" variable or simply rename it to something else then the applet loads without problems. Normally I would just use a different variable name but the variable name is placed within the Mootools JavaScript Framework and is not easily changed without forking my own project.
    Does anyone know why this happens and if it can be fixed without having to update to the latest version of Java?
    Thanks

    EJP wrote:
    'this.document' is a predefined variable that defines the URL source of the current page. If you are referring to the predefined variable that provides access to the Document Object Model then I believe you are mistaken, that is 'window.document' or just 'document'.
    EJP wrote:
    Your name either conflicts with that or is getting confused with it somewhere.The 'document' variable is a parent of the window object e.g. 'window.document' but my variable has the context of 'this'. That means 'this.document.URL' returns 'undefined' instead of the URL for the current page.
    JavaScript is also case sensitive so 'document.URL' is not the same as 'Document.URL', the last of which returns 'undefined'.
    If Java relealy was confusing my variable with the predfined one then I would expect the same behaviour if I were to use differnt variations of the variable. However the follwoing JavaScript doesnt affect the Applet in anyway:
    <script type="text/javascript" language="javascript">
        //this.Document = 'string'; // Remove this line to get it to work again
        this.document = 'string';
        document = 'string';
        Document = 'string';            
    </script>For some strange reason it only affects the Applet when 'this.Document' is used. Why would Java be affected in this way in the first instance? Even setting the 'scriptable' parameter to false doesn’t help:
    <param name="scriptable" value="false">Are there any other settings I am not aware of that could maybe prevent Java from loooking at the JavaScript?
    EJP wrote:
    Use another name.As I mentioned in my original post this is not easily done, I can edit the source code on my own site but the code still remains unchanged on the Mootools JavaScript Framework website.
    Thanks

  • Applet won't initialize when testing Applet

    I compiled my file with no errors, yet when I test the Applet it tells me that it can not initialize, can anyone help me.
    Thanks

    Some source code causing the problem would be nice. Also, if are viewing your Applet in a browser make sure you are using JDK 1.0/1.1 classes/methods.
    Open your java console in your browser to see exactly what the Exception (if any) that is being thrown. (To enable your java console your might have to edit your browser settings, in IE you can do this through your tools/internet options/advanced then check the java console box.)

  • Java applet won't load from Jar file

    Hi all,
    I have a problem which I didn't used to have. I have written an applet which used certain classes stored in directories. It used to work just fine. I recently updated the main class from which the applet starts and since then I get error messages:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03-384-10M3425 Java HotSpot(TM) 64-Bit Server VM
    User home directory = /Users/benoize
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class WiaRekenToolHC.class not found.
    java.lang.ClassNotFoundException: WiaRekenToolHC.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
         at java.lang.Thread.run(Thread.java:680)
    Exception: java.lang.ClassNotFoundException: WiaRekenToolHC.class
    As you can see it says that it can't find the class WiaRekenToolHC, but it's there in the jar files.
    Here is the link where you can see it:
    www.creativemathsolutions.nl/demo/HC/demo.html
    The jar files are in the directory HC and Generic.
    If you need more info then let me know!
    Regards, Benoit

    <applet
      codebase="http://www.creativemathsolutions.nl/demo/HC"
      code="WiaRekenToolHC.class"
      ARCHIVE="HC/wia_hc_archive_v0_3.jar, Generic/wia_archive_v0_3.jar"
      width=900 height=600>The code-base combined with archive href for the first Jar mean the JRE will look for it at:
    http://www.creativemathsolutions.nl/demo/HC/HC/wia_hc_archive_v0_3.jar
    It is not there. The other Jar is also missing from the stated location.

  • Java applet won't run: ClassFormatError: Unknown constant tag 115

    Hi,
    About two years ago I uploaded an applet to a server and it ran fine. Since then I've done minor tweaks to the applet and it works on my computer, but I recently uploaded it to a new server and now it gives me the following:
    java.lang.ClassFormatError: Unknown constant tag 115 in class file chemlet
         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.ClassFormatError: Unknown constant tag 115 in class file chemlet
         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)
    I've already checked that I uploaded everything in binary and that my .class files are intact on the server. In fact I uploaded my files and downloaded them back onto my computer and they run fine. Also I have another applet running smoothly on the same server (which also used to reside on the old server) and it's not having any problems. I have 9 .class files in total and all of them are uploaded. chemlet is the file where execution should start. Any ideas for what to do?
    Thanks in advance.

    Either there is some version problem in applet. or the classfile might have some constant which is not getting referenced properly.
    might be in your chemlet file . use decompiler to open your class file and then check the line number 115 in your chemlet file to see what is the problem there.

  • Installed JDK but Java applets won't run in browsers

    My system: Windows7 x64 (fresh install - so no previous JRE's or JDK's), Firefox 15.0.1 and IE9
    I downloaded this: jdk-7u7-windows-x64.exe
    From this page: [http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html]
    I installed the JDK as per instructions on this page: [http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html]
    I updated the PATH environment variable to include: C:\Program Files\Java\jdk1.7.0_07\bin
    I restarted the computer.
    I checked cmd for java -version, it reports: java version "1.7.0_07" java SE Runtime Environment (build 1.7.0_07-b11) etc...
    I tried to view applets in Firefox and IE and they both report that I have to download the Java plugin.
    IN Firefox I click "Install plugin" and it looks like it's installing, but then it fails. It then gives me an option to install it manually (which is a link to the Oracle JRE download page.
    I did not try that last option because I SHOULD NOT HAVE TO, Oracle's page clearly states [http://docs.oracle.com/javase/7/docs/webnotes/install/index.html] that the JDK INCLUDES the JRE.
    "... If you want to develop Java applications, download the Java Development Kit, or JDK. *The JDK includes the JRE, so you do not have to download both separately.*"
    Also, it the latest JDK is supposed to come with JavaFX development capabilities, but I don't see JavaFX stuff in any of the Java folders.

    Hi,
    You might want to look in your control panel for 'Java' icon. It should give you an option to enable java plugin into your browser. Let me know if you still face the issue.
    Thanks!

  • Java Applet Won't Load

    I try to use this site http://www.csupomona.edu/%7Ewgverbrugge/Billweb/TestAPPS/SimulatedMach/MachineUI.html
    It says load: class MachineUI.class not found.
    load: class MachineUI.class not found.
    java.lang.ClassNotFoundException: MachineUI.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)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
    basic: Exception: java.lang.ClassNotFoundException: MachineUI.class
    java.lang.ClassNotFoundException: MachineUI.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)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    basic: Modality pushed
    basic: Modality popped
         ... 10 more

    EJP wrote:
    'this.document' is a predefined variable that defines the URL source of the current page. If you are referring to the predefined variable that provides access to the Document Object Model then I believe you are mistaken, that is 'window.document' or just 'document'.
    EJP wrote:
    Your name either conflicts with that or is getting confused with it somewhere.The 'document' variable is a parent of the window object e.g. 'window.document' but my variable has the context of 'this'. That means 'this.document.URL' returns 'undefined' instead of the URL for the current page.
    JavaScript is also case sensitive so 'document.URL' is not the same as 'Document.URL', the last of which returns 'undefined'.
    If Java relealy was confusing my variable with the predfined one then I would expect the same behaviour if I were to use differnt variations of the variable. However the follwoing JavaScript doesnt affect the Applet in anyway:
    <script type="text/javascript" language="javascript">
        //this.Document = 'string'; // Remove this line to get it to work again
        this.document = 'string';
        document = 'string';
        Document = 'string';            
    </script>For some strange reason it only affects the Applet when 'this.Document' is used. Why would Java be affected in this way in the first instance? Even setting the 'scriptable' parameter to false doesn’t help:
    <param name="scriptable" value="false">Are there any other settings I am not aware of that could maybe prevent Java from loooking at the JavaScript?
    EJP wrote:
    Use another name.As I mentioned in my original post this is not easily done, I can edit the source code on my own site but the code still remains unchanged on the Mootools JavaScript Framework website.
    Thanks

  • Help with java applets

    Ok i know i haven't read the applet tutorial or had much experience with applets but just hear me out and see if you can help me.
    BACKGROUND
    Ok...so i have previously viewed an applet on windows viewing an html file on my computer. I am trying to view just the most simple applet (helloworld) on linux. I'm using Ubuntu linux, the latest version as of February 23, 2006.I created an applet file and an html file in the same directory with the html file having an <applet> tag in it linking to the HelloWorldApp. I have tried viewing the html file and the java applet won't load. Everything other than the applet worked and I'm just stuck.
    So my plea is would somebody please just paste the bare minimum html file and applet file that you can see an applet with? I want to learn about applets and will do the tutorial but I would really like to just see one.
    Please help,
    A frustrated applet noob
    p.s.
    According to java.com I have installed JRE 5.0 and i have compiled a java application so I'm pretty sure I have successfully installed JDK 5.0.

    Bob, what web browser are you using?
    Make sure that the browser supports Java applets.
    If you want just to debug your applet try appletviewer utility
    from JDK first.

  • Java noob needing help - First applet won't compile

    I'm trying to make a simple audio player applet for a web page. The basic way it works is: There are four buttons Play 1, Play 2, Play 3 and Stop, as well as a label for applet credits, a label for music credits and a label for the applet's current status.
    This is the applet so far:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    public class wifflesaudio extends Applet implements MouseListener {
    add(new Label("(applet credits"));
    add(new Label("(music credits"));
    Label labelDoing = new Label("Stopped");
    Button buttonOne = new Button("Play 1");
    Button buttonTwo = new Button("Play 2");
    Button buttonThree = new Button("Play 3");
    Button buttonStop = new Button("Stop");
    add(buttonOne);
    add(buttonTwo);
    add(buttonThree);
    add(buttonStop);
    addMouseListener(this);
    String clipName[] = {getParameter("clipOne"),
    getParameter("clipTwo"),
    getParameter("clipThree")};
    AudioClip clipOne;
    AudioClip clipTwo;
    AudioClip clipThree;
    int whichIsPlaying = 0;
    public void loadClip(int clipNumber) {
    switch (clipNumber) {
    case 1:
    if (AudioClip.clipOne == null) {
    try {
    labelDoing = "Loading clip 1...";
    clipOne = Applet.newAudioClip(newURL(getCodeBase(), clipName[1]));
    catch (MalformedURLException e) {
    labelDoing = "WARNING: clip 1 didn't load";
    if (clipOne != null) {
    clipTwo.stop();
    clipThree.stop();
    clipOne.loop();
    whichIsPlaying = 1;
    break;
    case 2:
    if (clipTwo == null) {
    try {
    labelDoing = "Loading clip 2...";
    clipTwo = Applet.newAudioClip(newURL(getCodeBase(), clipName[2]));
    catch (MalformedURLException e) {
    labelDoing = "WARNING: clip 2 didn't load";
    if (clipTwo != null) {
    clipOne.stop();
    clipThree.stop();
    clipTwo.loop();
    whichIsPlaying = 2;
    break;
    case 3:
    if (clipThree == null) {
    try {
    labelDoing = "Loading clip 3...";
    clipThree = Applet.newAudioClip(newURL(getCodeBase(), clipName[3]));
    catch (MalformedURLException e) {
    labelDoing = "WARNING: clip 3 didn't load";
    if (clipTwo != null) {
    clipOne.stop();
    clipTwo.stop();
    clipThree.loop();
    whichIsPlaying = 3;
    break;
    public void actionPerformed(ActionEvent evt) {
    Button source = (Button)evt.getSource();
    if (source.getLabel().equals("Play 1")) {
    loadClip(1);
    if (source.getLabel().equals("Play 2")) {
    loadClip(2);
    if (source.getLabel().equals("Play 3")) {
    loadClip(3);
    if (source.getLabel().equals("Stop")) {
    clipOne.stop();
    clipTwo.stop();
    clipThree.stop();
    Naturally, it doesn't work. When I try to compile it with javac I get 21 errors thrown back at me. Being the noob that I am I have absolutely no idea why it isn't working, so I'm turning to all you clever people for some advice. :)

    Think anyone's going to copy your code into their own machine and compile it to see those messages for you? Well I did. Since there are a zillion error messages, I think it's fair to help a little bit:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    // no need to implement MouseListener
    // see below
    public class wifflesaudio extends Applet {
        Label labelDoing = new Label("Stopped");
        Button buttonOne = new Button("Play 1");
        Button buttonTwo = new Button("Play 2");
        Button buttonThree = new Button("Play 3");
        Button buttonStop = new Button("Stop");
        String[] clipName;
        AudioClip clipOne;
        AudioClip clipTwo;
        AudioClip clipThree;
        int whichIsPlaying = 0;
        // statements in JAVA must be located with methods or constructors
        // here is the default constructor (with no param)
        wifflesaudio() {
            add(new Label("(applet credits"));
            add(new Label("(music credits"));
            add(buttonOne);
            add(buttonTwo);
            add(buttonThree);
            add(buttonStop);
            clipName = new String[3];
            clipName[0] = getParameter("clipOne");
            clipName[1] = getParameter("clipTwo");
            clipName[2] = getParameter("clipThree");
            addMouseListener(new wifflesaudioMouseListener()); // instead of addMouseListener(this)
        public void loadClip(int clipNumber) {
            switch (clipNumber) {
            case 1:
                if (clipOne == null) {
                    try {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("Loading clip 1...");
                        clipOne = newAudioClip(new URL(getCodeBase(), clipName[1])); // 'new URL' instead of 'newURL'
                    } catch (MalformedURLException e) {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("WARNING: clip 1 didn't load");
                if (clipOne != null) {
                    clipTwo.stop();
                    clipThree.stop();
                    clipOne.loop();
                    whichIsPlaying = 1;
                break;
            case 2:
                if (clipTwo == null) {
                    try {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("Loading clip 2...");
                        clipTwo = newAudioClip(new URL(getCodeBase(), clipName[2])); // 'new URL' instead of 'newURL'
                    } catch (MalformedURLException e) {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("WARNING: clip 2 didn't load");
                if (clipTwo != null) {
                    clipOne.stop();
                    clipThree.stop();
                    clipTwo.loop();
                    whichIsPlaying = 2;
                break;
            case 3:
                if (clipThree == null) {
                    try {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("Loading clip 3...");
                        clipThree = newAudioClip(new URL(getCodeBase(), clipName[3])); // 'new URL' instead of 'newURL'
                    } catch (MalformedURLException e) {
                        // To set the text of a label, you must use setText() method.
                        labelDoing.setText("WARNING: clip 3 didn't load");
                if (clipTwo != null) {
                    clipOne.stop();
                    clipTwo.stop();
                    clipThree.loop();
                    whichIsPlaying = 3;
                break;
        public void actionPerformed(ActionEvent evt) {
            Button source = (Button)evt.getSource();
            if (source.getLabel().equals("Play 1")) {
                loadClip(1);
            if (source.getLabel().equals("Play 2")) {
                loadClip(2);
            if (source.getLabel().equals("Play 3")) {
                loadClip(3);
            if (source.getLabel().equals("Stop")) {
                clipOne.stop();
                clipTwo.stop();
                clipThree.stop();
        // Extending MouseAdapter instead of implementing MouseListener
        // allows NOT to code ALL the methods from MouseListener
        // MouseAdapter already implements MouseListener with empty methods
        // You then just code the method(s) that is (are) needed.
        class wifflesaudioMouseListener extends MouseAdapter {
    }Please next time paste your code between code tags exactly like this:
    &#91;code&#93;
    your code
    &#91;/code&#93;
    Thank you

Maybe you are looking for

  • Bind two DataGrids so that a change in one will be refelected in another

    Is there a simple way to bind two DataGrids so that a change in one will be refelected in another?  I have two DataGrids.  One will be editable and the other will be used to display the information from the editable DataGrid in a confirmation section

  • Why does iPhoto need almost all my private Facebook info?

    I like iPhoto functionality of easy sharing photos on many services like Facebook. I know that there are some issues regarding it but something worries me a little. Unlike any other app, iPhoto requires almost all information that is private for me o

  • Suggested XCode feature

    I had an astoundingly difficult time trying to get XCode to stop giving "No such file or directory" errors for things which quite obviously did exist. I eventually figured out what was wrong when I tried to copy/paste the Header Search Paths line to

  • How to Display Node Data ( 100 Lines ) in INteractive form UI Element

    HI All, I have requirement to display Standard report output in interactive form UI element .I have taken the Stadard report Output to an internal table and converted into xstring format and trying to exporting to the node with attribute type xstring

  • Screen Capture from DVD?

    This is probably the wrong place to post, but I need help in a hurry. Is there a way to do a video capture from a DVD movie that is paused? I need to get a photo and the only place I have it is in a DVD movie. Thanks,