Applet not running outside of netBeans

I have an applet that was compiled & built within NetBeans 4.1 under jdk1.5.0_04. It runs perfectly inside of NetBeans. It doesn't run outside of NetBeans.
I created the HTML launcher file and placed it in the same folder where the applet class file resides.
<HTML>
<BODY>
<APPLET CODE=Main.class
WIDTH=250
HEIGHT=130>
</APPLET>
</BODY>
</HTML>
When I launch the HTML file under windows XP I get a NullPointerException.
When I try to use appletviewer I get the following:
Warning:Can't read AppletViewer properties file: c:\Documents and Settings\walter88\.hotjava\properties using defaults. I/O exception while reading: c:\Program (The system cannot find the file specified).
Someone please help this 'newbie'.
Thanks.

Thanks for your reply. here is the applet code:
package javaapplication4;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.DecimalFormat;
public class Main extends JFrame
    implements ActionListener {
    private JButton button;
    public static void main(String[] args) {
        Main frame = new Main();
        frame.setSize(400, 300);
        frame.createGUI();
        frame.setVisible(true);
    private void createGUI() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container window = getContentPane();
        window.setLayout(new FlowLayout() );
        button = new JButton("Press me");
        window.add(button);
        button.addActionListener(this);
    public void actionPerformed(ActionEvent event) {
        DecimalFormat df1 = new DecimalFormat( "#####.0000");
        String Od, Length, Weight, Density;
     double od, length, weight, density, const_1, const_2, or, wall;
     Od = JOptionPane.showInputDialog("Enter OD of tubing (inch)");
     Length = JOptionPane.showInputDialog("Enter length (inch)");
     Weight = JOptionPane.showInputDialog("Enter weight (grams)");
     Density = JOptionPane.showInputDialog("Enter density (lbs/in3)");
     od = Double.parseDouble( Od );
     length = Double.parseDouble( Length );
     weight = Double.parseDouble( Weight );
     density = Double.parseDouble( Density );
     or = .5 * od;
     const_1 = 3.14159 * 453.59 * density * length;
     const_2 = -4 * const_1 * or;
     wall = (-const_2 - Math.sqrt(const_2 * const_2 - 4 * const_1 * weight))/(2 * const_1);
        JOptionPane.showMessageDialog(null, "Wall thickness is: " + df1.format(wall) + " inch");
}

Similar Messages

  • Applet not running in the broweser.

    Hello everyone I have a problem that is bugging me.
    in my pc at home i have operating system window xp i have oracle9i installed and also java and j2ee and version of internet explorer is 6.0
    .there is no proble running html pages but the problem is the applet are not running in the broweser even the java demo from sun is not running
    .when i try to run the applet a dialog box appears and shows this
    " jvm not find Download now" i do not have internet connection.
    and one more thing i want to down load or save file in webserver
    i donot know whether my pc is having default webserver but when i type this "http://localhost" a page of oracle is display listing jserver ,appache server and so many thing.
    do i have a webserver that can be used by me for java program(adv java) or i have to get one .as i told you there is java1.3 and j2ee1_2_3
    something like this i donot remember is there no default webserver along with them .how can i use them for my java programe .
    let me remind you the applet not getting downloaded in the browser is a bigger problem for me.
    i appreciate your concern please help me out
    have a nice day bye.

    1} The applet is not getting loaded in my internet
    browser.Error messages? Are you sure your setup is correct? Search. "Applet not working" usually has only a small range of reasons, all well-covered here.
    2}why the oracle page is displayed when i type
    "http://localhost".
    Maybe because you have some Oracle webserver?
    3} Do i have any default webbrowser in my system.Yes. The one that opens when you double-click on an HTML page.
    >
    thanks.

  • My Applet not running in java not installed systems.

    dear sir/madam,
    i have an applet which uses java.awt.* and java.awt.event.* classes, is running in systems with J2SE installed. but it is not running in systems with java enabled browsers without J2SE installation.
    i want my applet to be run in all java enabled browsers without J2SE also.
    how to make my applet work.
    thanks in advance.
    -- ks_moses

    install J2SE to develop Java programs..
    install JRE to run your Java Programs
    To run your applets into such a browser, you must have a plugin installed on that browser to run your applet, so install JRE(Java Runtime Environment), it will install the Java plugin automatically so you can run your applets, GoodLuck
    Regards,
    Mohammed Saleem

  • Applet not running in local browser

    I can run any applet from web.
    I can run any applet in appletviewer.
    But I can not run applets in browser from local html file.
    I can not run even the demos that came with de SDK 1.4.1_01.
    Can anyone give me some hint?
    Maybe is very obvious but I ca not see it.
    Thank you very much.
    Valeriu Sprintu

    the hello.java file is:
    import java.applet.Applet;
    import java.awt.Graphics;
    public class hello extends Applet {
    StringBuffer buffer;
         public void init() {
         public void start() {
         public void stop() {
         public void destroy() {
         public void paint(Graphics g) {
              //Draw a Rectangle around the applet's display area.
              g.drawRect(0, 0, size().width - 1, size().height - 1);
              //Draw the current string inside the rectangle.
              g.drawString("Hello", 5, 15);
    The hello.html file is:
    <html>
    <body>
    Applet should be there
    <br>
    <applet code="hello.class" width=200 height=200>
    No applet
    </applet>
    </body>
    </html>
    hello.html and hello.class are of course in the same folder.
    If I modify the .html file acording to OBJECT tag specifications for Java Plug-In the same applet runs OK in the browser (IE5.0 ).
    I forgot to tell that I have installed the last version of SDK j2sdk1.4.1_01
    <html>
    <body>
    Applet should be there
    <br>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 200 HEIGHT = 200 >
    <PARAM NAME = CODE VALUE = "hello.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
    No applet
    </OBJECT>
    </body>
    </html>
    I think there is a problem with the JVM from Microsoft
    Thank you,
    Best regards,
    ValeriuS

  • Applet Not Running in IE. Need IE settings for running applet.

    Hi
    I am facing a problem with Applet while running in IE-6. The problem is very simple; Applet is not running in IE-6, not even a simple applet which displays just a Label.
    I am using Java Version 1.4
    Settings for IE is as follows
    Java (Sun)
    CHECKED Use Java 2 v1.4.0 for <applet>
    Microsoft VM
    CHECKED Java console enabled
    NOT CHECKED Java logging enabled
    CHECKED JIT compiler for virtual machine enabled
    The applet is running in Appletviewer and run in IE in some other machine. The problem is in my browser and Java versions.
    If I start the applet in IE it is not showing even Jave Console (which is enabled).
    In Java Plugin (Control Panel) I enabled Show Console and set MSIE checked.
    What should I do to solve such a stupid problem with my IE. I have updated my JVM and IE twice but yet to wait for solution.
    Your help is worshipfully appericated.
    with love Vijay

    I got some reasonable solution from some other forum.
    The Problem is with the VM. The JVM is crashed with MS VM.
    That is why the browser diplays class not found error.
    This is because the MS VM is not allowing the JVM to look for .class files.
    This will happen for java 1.4.x .
    If you use HTML converter (converting the applet to object) it will work.
    But the Optimal solution is compile your applet file with -target option.
    e-g
    javac target 1.1 HelloWorld.java
    It is the most efficient way to avoid such problems with IE while running the applets.
    I Thank you all for your solutions.
    with love Vija

  • Applet not running on MAC OS X

    My applet works fine on windows but when my client run my applets on MAC OS Browser then it gives error on status bar like "Applet Not Loaded ".
    So How can i solve this problem . helpful advice is appreciated.

    The first advice given was the best advice you will get at this stage.
    OTOH, the problem might be that the compilation options used on Windows were for a 1.6+ JRE, whereas the Mac is running a 1.5 JRE.
    If that is the case, the relevant questions become..
    How do you compile the applet (e.g. IDE, IDE with Ant build script, command line..)?
    What SDK version are you using?
    What compilation options are used (the important ones here are -source -target and -bootclasspath )?
    What [java version|http://pscode.org/prop/?prop=java.version] is the Mac using?
    Also note that many things* can be determined if you provide an URL to the applet.
    * Especially if someone has a Mac and can report the error.

  • Applets not running with IE6

    Using IE6 I can't get any applets to run on any web page. Its seems the Microsoft VM is not functioning correctly. Is there some setting that controls this. I do not want to use the Sun VM. My OS is Win 2000.
    Thanks

    Go to your preferences, and find the java page. Check to see that java is turned on.
    If there is no java page, you'll need the plug-in.

  • 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

  • Applet not running Jama Package.

    Hello! I am trying to create an applet which at some point should solve a linear system. I tried using the Jama Package. I have written a program which does exactly the same thing as the applet and everything works fine.However when i try to run the applet i get a "java.lang.NoClassDefFoundError : Jama / Matrix " error.
    In the applet code i have imported jama package. Any ideas what is wrong and the appletviewer cannot see the Jama.Matrix class?
    Thanx in advance for any answers...

    A description of the ERROR from the error's API:
    Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
    The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
    Typically caused by your not making the class available - that is, it's not on your machine (or is, but in a location such that it can't be found.)
    Put a copy in the correct location.

  • Applet not running(Error:error reading applets)

    i write a very simple applet .it succesfully compile but on running thru command prompt(windowsxp) it gives error error reading applets

    The first advice given was the best advice you will get at this stage.
    OTOH, the problem might be that the compilation options used on Windows were for a 1.6+ JRE, whereas the Mac is running a 1.5 JRE.
    If that is the case, the relevant questions become..
    How do you compile the applet (e.g. IDE, IDE with Ant build script, command line..)?
    What SDK version are you using?
    What compilation options are used (the important ones here are -source -target and -bootclasspath )?
    What [java version|http://pscode.org/prop/?prop=java.version] is the Mac using?
    Also note that many things* can be determined if you provide an URL to the applet.
    * Especially if someone has a Mac and can report the error.

  • Applet not running

    I'm presently using the Java Tutorial downloaded recently, but I counld'nt run tha Applets because Java plug in is not installed. I'm using windows XP Proffessional . Is the Plug in not included with j2sdk1.4.2 (net beans included). How do I get the applets running?

    If you don't see a Java Plug-in entry in the Control Panel, go to http://java.com/en/index.jsp and click "Get It Now". This initiates an automatic install of the Plug-in.

  • Signed Applet not running in netscape browser

    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 695 HEIGHT = 525 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <PARAM NAME = CODE VALUE = SignedAppletDemo >
    <PARAM NAME = CODEBASE VALUE = "." >
    <PARAM NAME = ARCHIVE VALUE = "SSignedApplet.jar" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="scriptable" VALUE="false">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.3" CODE = SignedAppletDemo CODEBASE = "." ARCHIVE = "SSignedApplet.jar" WIDTH = 695 HEIGHT = 525 scriptable=false pluginspage="http://java.sun.com/jpi/plugin-install.html"><NOEMBED></COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    what i wann that when i run this code in netscape browser that it won't ask the user to download the plugin for the applet it should automatically download plz do me favour and send me solution thanks

    Hello.
    Due to firewall issues I cannot state for certain if I am having a similar behaviour to yours. It appears that Netscape( 7.1 ) attempts to resolve to plugins.netscape.com irrespective of the pluginspage attribute ( if it resolves further I cannot see it due to firewalls ). IE appears to try and autoupdate ( based on the firewall challenges ).
    You could try and provide a conditionally constructed link ( with information about the JRE failure ) to the JRE of choice between comment/embed/object elements. It is not the solution you asked for, but a potential alternative.
    Regards,
    James.

  • 3D Applet not running in IE, Mozilla, etc ...

    Hi,
    I have programmed an 3D applet with the J3D engine.
    When I start the .jar everything is fine.
    I have created the JAR with JBuilder and a main-class definition.
    Now I want to run the JAR as an applet.
    The HTML I have written seems to be OK because the brwosers say "Applet blabla started."
    The applet area just stays white ...
    Where can I find something like a log of the starting process or the errors that occur in my java app?
    Thanks in adavnce!

    I got some reasonable solution from some other forum.
    The Problem is with the VM. The JVM is crashed with MS VM.
    That is why the browser diplays class not found error.
    This is because the MS VM is not allowing the JVM to look for .class files.
    This will happen for java 1.4.x .
    If you use HTML converter (converting the applet to object) it will work.
    But the Optimal solution is compile your applet file with -target option.
    e-g
    javac target 1.1 HelloWorld.java
    It is the most efficient way to avoid such problems with IE while running the applets.
    I Thank you all for your solutions.
    with love Vija

  • Applet not running in the oracle 9i App server 9.0.2

    hi
    i am trying to run the applet from default-web-app but it is saying class not found .
    i have also created the war file but it is giving the same problem.
    actually it a part of applet servlet communication if any one has done it please reply

    I install 9ias 9.0.2 successfully on dell 8450, but cann't start portal instance and wireless instance.

  • Applet not running with firefox

    Hi,
    When I try to open a local file with extension .xml containing an applet it does not show up in firefox (3.0.6) java 1.6.0_11. The same file renamed .html works.
    I have this behaviour on windows (vista or XP)
    I have been told that opera is working for both files on windows, and firefox is working on macintosh.
    test files could be dowloaded at http://www.pimeca.com/test.zip
    any help appreciated.

    I'm having the same problem with IE7 running on XP SP2. All web sites that i visit the require JRE (Morningstar, Schwab, Marketedge, Sun Java Verify Site) return 'Jave Plug-In Fatal Error: Several JVMs running the same process caused and error. I'm running JRE 1.5.0_06. I've tried uninstall/reinstall of IE7 with no change. No problems running JRE on IE6 or Netscape. Does anyone know of any progress on this issue?

Maybe you are looking for

  • How do I set up the printer default so that it prints black only, with all my devices and iMac

    Have an Officejet 8600 Plus, used with an iMac. Also using wireless feature to print from iPads and iPhones. The printer has been setup from the iMac to print using the black ink cartridge, only. The problem is with my devices. I am unable to figure

  • Why is my mbpro mic better than my usb

    I bought a decent plantronics usb microphone - but people keep on telling me the mac mic is better, when they talk to me online. Does anyone know why this is - been through a bunch of usb mics and this is usually the case.  It's annoying because it m

  • Better way of managing heirarchical groupings?

    Sort of a feature request, but also a question to other users about different approaches you like to use.  I've often wished for a way of grouping layers in a heirarchy that is independant of layer order, like you can do in most 3D apps (or -ahem- no

  • --eh-frame-hdr

    I'm trying to install Oracle 9ir2 on Red Hat 9. I keep getting to a point in the linking portion where I get this error: Error in invoking target install of makefile /opt/ora9/product/9.2/plsql/lib/ins_plsql.mk I tried changing: LD_SELF_CONTAINED="-z

  • Lightroom 4.4 will not open despite deleting .lock file

    I have deleted the .lock files already but am still getting "light room cannot be opened because another application has it opened" Help!!  I read on the forum to delete the .lock file but nothing seems to be working.