How to run a Applet in a browser. No one REPLIED. Plz help

I had created a applet.
When I run it in ECLIPSE, the applet program runs well.
But when I try to open the applet program in browser
by storing the html file in the director in which I had the class file ,
my applet is not running.
In the browser's bottom status bar , it says "notinited".
I dont know what is the mistake.
Please tell me what I should do. I am pasting my html file here.
<HTML><applet code="MortgagecalculationApplet.class" width=421 height=481></applet>
</HTML>

Hi..
Well I tried doing somthing which worked.. would like to share with you...
actually in the jar file created , if the class file is kept in the root directory of the jar file... it works...
eg. while crating the jar, if we go to the directory of the class file and then create it , it ould work..
if u r in som other directory while creating the jar, it wont work..
for the jar created, open it with winzip and if in the path column of the required class file if it shows a path, then it wont work..
else it will..
dats wat I ve found out....

Similar Messages

  • How to run swing applets in a browser??

    I understand it is a typical question and there lot of articles on it. I tried but am confused. I installed JRE1.3 which has java plug-in along with it which supports swing applets in a browser.Once i got that plug in i also downloaded html converter but am confused how should i run my swing applet.Can anyone please explain in simple steps as to how to achieve this objective..Thanks much in advance..an example would be of real big help
    Thanks

    The below links will help you.
    http://java.sun.com/products/plugin//1.3/docs/index.docs.html
    http://java.sun.com/products/plugin/1.3/plugin.faq.html

  • HOw to run the Applet in dos mode

    how to run the applet in Command Prompt(DOS).
    I have save this in directory D/vijay/javap/A.java and my JDK is in C drive.
    Plz send me reply as soon as possible.
    My code is :-
    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
         w = 45;
         h = 50;
    public void paint(Graphics g)
         g.drawRect(w, h, 20, 80);
    }

    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
    w = 45;
    h = 50;
    public void paint(Graphics g)
    g.drawRect(w, h, 20, 80);
    <applet class="A" height="200" width="200" code="A.class">
    </applet>
    */And in command prompt
    javac A.java
    appletviewer A.java
    Message was edited by:
    passion_for_java

  • How to run an Applet using the JDK1.3.1 platform?

    I'm a beginner of Java Applet.
    I've type in the sample program provided in the text book, and compiled it using the jdk1.3.1 platform.
    Usually we run a java program using java [filename], right?
    How about running an applet file?
    What is appletviewer function?
    Thanks!

    I try to put it in a HTML page but it required me to download a Java Virtual Machine.
    I've been searching sources for that but stil cannot get.
    This is always what I get:
    [We're sorry, you cannot view this page because it requires the Microsoft Java Virtual Machine (MSJVM). Your machine does not have the MSJVM installed. For more information please visit www.microsoft.com/java.]
    I visit java.sun.com. On the right side of the page listed with the HOT DOWNLOADS.
    I click on the Java VM but still cannot get anything...
    Can u help me on that?
    I've been trying for 2 days already.
    Thanks!

  • How to run the compiled wedforms to browser?

    Ladies and gentlemen,
    Kindly give me the a sample command on how to run the forms in
    the browser.
    Billy,
    null

    I have the same problem , the mini virus is so slow and unpredictable it is a joke.
    There is no way to disable it.

  • How to run an applet(in a html file) in the server?

    I am using the jpedal Viewer inmy code, I embedded the applet code
    in a html file , it is running fine, but when I try to run the same Viewer applet in the Server it is throwing an error
    "java.lang.NoClassDefFoundError: org/jpedal/objects/acroforms/DefaultAcroRenderer
         at org.jpedal.PdfDecoder.startup(Unknown Source)
         at org.jpedal.PdfDecoder.<init>(Unknown Source)
         at pdfViewer.PdfApplet.init(PdfApplet.java:199)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)"
    What is the problem ?
    Please suggest solution for it?
    Its urgent

    I am trying to run the Applet in Tomcat server,
    Could you post the code where you invoke the Applet? It sounds like you're saying you're trying to run the Applet as part of your server-side code. The other interpretation is that you are simply accessing the Applet through the browser that happens to be on the machine being used as the server.
    Like I say, post the code that shows how you're trying to use the Applet "on the server".

  • How to run the bw workspace in browser

    Hi Folks,
    Good Day!.
    I have created bw workspace in bw system powered by hana and may iknow the option how to run the workspace in browser.
    Please guide.
    Thanks,
    Hari

    You will need to install a JRE to take over the VM of your browser. JRE stands for Java Runtime Eviroment.
    Do this, and you will be able to view applets using Swing in your browser. JRE can be found on the download page. About security concerns, I've got a Swing Applet to work with access to client clipboard so this is also possible. For some people however this does not seem to work. I dont know why but perhaps it could work for you. Check out the thread http://forum.java.sun.com/thread.jsp?forum=63&thread=197092

  • How to run swing applets???

    I already posed this question yesterday but i got no replies.please help me out.
    I understand it is a typical question and there lot of articles on it. I tried but am confused. I installed JRE1.3 which has java plug-in along with it which supports swing applets in a browser.Once i got that plug in i also downloaded html converter but am confused how should i run my swing applet.Can anyone please explain in simple steps as to how to achieve this objective..Thanks much in advance..an example would be of real big help
    Thanks

    u need to convert ur html-page with the applet-tags with the htmlconverter.

  • How to run an applet with .java files in 2 dirrerent directories ?

    I have an applet with :
    5 .java class files and its .html file in one directory and
    2 .java class files ( with identical names) and its .html file in another directory .
    How do I go about executing this applet ? In the past all the applets
    I have run had all the classes in one directory.
    Thank you in advance

    If you want them both in the same page, put both applet tags in 1 page,
    I could do that but both directories have a SpaceDunes.class
    and both directories have a Shot class (diffferent immplementations
    but the same name)
    so the applet tag
    <APPLET CODE="SpaceDunes.class"
    CODE="SpaceDunes.class"
    This can't be the right approach ? ?
    Thank you for your advice
    <HTML>
    <HEAD>
      <TITLE>SpaceDunes Applet
      </TITLE>
    </HEAD>
        <BODY>
         <H1>SpaceDunes Applet
        </H1>
          <HR>
            <APPLET CODE="SpaceDunes.class"
                              CODE="SpaceDunes.class"
                         WIDTH=500
                         HEIGHT=500
                           CODEBASE=".">
                ALT="Your browser understands the <APPLET>
                         tag but isn't running the applet, for some reason."
                          Your browser is ignoring the <APPLET> tag!
          </APPLET>
         <HR>
        </BODY>
    </HTML>

  • How to run "ClickMe" applet?

    public class Spot {
    public int size;
    public int x, y;
    public Spot(int intSize) {
    size = intSize;
    x = -1;
    y = -1;
    ===================================================================
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class ClickMe extends Applet implements MouseListener {
    private Spot spot = null;
    private static final int RADIUS = 7;
    public void init() {
         addMouseListener(this);
    public void paint(Graphics g) {
         //draw a black border and a white background
    g.setColor(Color.white);
         g.fillRect(0, 0, getSize().width - 1, getSize().height - 1);
    g.setColor(Color.black);
         g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
         //draw the spot
    g.setColor(Color.red);
         if (spot != null) {
         g.fillOval(spot.x - RADIUS, spot.y - RADIUS, RADIUS * 2, RADIUS * 2);
    public void mousePressed(MouseEvent event) {     
    if (spot == null) {
    spot = new Spot(RADIUS);
         spot.x = event.getX();
         spot.y = event.getY();
         repaint();
    public void mouseClicked(MouseEvent event) {}
    public void mouseReleased(MouseEvent event) {}
    public void mouseEntered(MouseEvent event) {}
    public void mouseExited(MouseEvent event) {}
    ==============================================
    how to run it ?
    Thank you advance~

    1.I have compiled it like this D:/>javac ClickMe.java
    2.I also have wirtten "HTML":<applet code=ClickMe.class width=100 height=50>
    </applet>
    3.My problem is the compiling,there have many errors.The compiler say :It is CLASSPATH error.
    I want to know when I run a applet how to set CLASSPATH in different conditons, such as the applet have
    package or not have package .
    Especially, I want to know how the "ClickMe" run.
    thank you all the same .

  • How to run 3d swing on the browser? how to use pugin  HTML conventer??

    hi dear all,
    I have problem now. I want to run my program in the browser. i use java 3d swing in my code as well. I look from books.It is saying that is possiable to do it , but , you have to use the java pugin conventer . I have tried , and it is not work on my computer , i have been doing just this for a week . If someone can give me some help , i will really really greatful about it .
    Thank you in advance .
    regards
    jojo

    What kind of command - HTML is a markup language not an execution language. If you mean how can you display an HTML document then use WEB.SHOW_DOCUMENT()

  • Sorry if i sound foolish how to run an applet through a java application

    I am into java from last one month ank keep on exploring it in the want to
    recently i created a application cum applet in the same class like
    applet is doing its own task and there is a main method in the code
    that does entirly different task lets assume displaying *'s on the dos prompt the program is getting complied and belive it its running as desired
    but the only problem that i m facing if i use appletviewer Myclass.java
    only the appletprog is displayed
    and if i run java Myclass than only dos task is done
    may be it is sounding foolish for most of you but if i can get a way
    which will help me in excecuting only one of it and both of them run succesfully
    it tryied different ways to do it but was not succesful
    please do not get irreated if its bizzered but if you really have a solution for it .i will appreciate it
    thanking you

    Yes you can run an Applet from an application. The magic bit is providing an AppletContext and AppletStub!
    Here's how you start it:
            wpa = new WayPointsApplet(this);
            new AppletWrapper(wpa, 380, 320);Here's the class definition: (includes code for my application that can be ignored.
    // Define a wrapper class for the applet
    class AppletWrapper extends Frame implements AppletStub, AppletContext {
        Applet applet;
        // Constructor
        AppletWrapper(Applet a, int x, int y) { 
              applet = a; 
              setTitle(a.getClass().getName());
              setSize(x, y);
              Dimension ss = Toolkit.getDefaultToolkit().getScreenSize();
              setLocation((ss.width-x)/2, (ss.height-y)/2);
              add(a, "Center");
              a.setStub(this);
              // Trap window closing
              addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent we) {
                    // Test if Write left undone before exiting???
                    if(WayPoints.wpa != null) {
                      if(!WayPoints.wpa.okToExit())
                         return;           // Ignore
                    applet.stop();
                    applet.destroy();
                    if(WayPoints.debug || WayPointDefs.plot_debug) {
                      SaveStdOutput.stop();
                    System.exit(0);         // EXIT Program
              });  // end WindowListener
              a.init();
              show();
              a.start();
       } // end constructor
        // AppletStub methods
        public boolean   isActive() { return true; }
        public URL       getDocumentBase() { return null; }
        public URL       getCodeBase() {
            return WayPoints.currDir;
        public String    getParameter(String name) {
            if (name.equalsIgnoreCase("DEBUG")) {
                if (WayPoints.debug)
                    return "YES";
                else
                    return "NO";
            if(name.equals("PLOTDEBUG"))
                return (WayPointDefs.plot_debug ? "YES" : "NO");
            if (name.equalsIgnoreCase("SERVER"))
                return "NO";
            return "";
        public AppletContext getAppletContext() { return this; }
        public void      appletResize(int width, int height) {}
        // AppletContext methods
        public AudioClip getAudioClip(URL url) { return null; }
        public Image     getImage(URL url) { return null; }
        public Applet    getApplet(String name) { return null; }
        public Enumeration getApplets() { return null; }
        public void      showDocument(URL url) {}
        public void      showDocument(URL url, String target) {}
        public void      showStatus(String status) {}
    } // end class AppletWrapper

  • How to run the applet in JSP

    hi,
    im trying to run an applet from JSP i am not able to see the output of the applet on the JSP page?
    <APPLET CODE="com.metro.supex.admin.SampleApplet.class" HEIGHT="25" WIDTH="125" ALIGN="bottom"></APPLET>
    this line of code is included in JSP to run the applet, it is giving error
    java.lang.ClassNotFoundException:com.metro.supex.admin SampleApplet
    please can you help me in this matter.

    And don't use the applet tag, use object embed.
    use the htmlconverter in the jdk bin dir to convert an applet tag.

  • How to run different versions of Apache Tomcat on one machine?

    Hi, I am developing a web application. My application runs on Apache Tomcat 5.5.12 and i am using jdk 1.5_03. My application detects files that are automatically scanned to a specific directory and queues them for capture in a database.
    The scanner software (HP Toolbox) is also a web application (Unfortunately), it installs itself with Apache Tomcat 4.03. It is "wired" in a specialised way (not the way you would usually deploy web apps). So the Web server is customised by HP (Hewlett-Packard).
    The scanner needs this software running inorder to automatically scan to a specified folder. You can only specify local directories to scan to from the Toolbox application
    There seems to be some resource conflict when I run my version of Tomcat when the Toolbox application is running (I get an exception
    ..IllegalMonitorState...current thread not owner). Visa vera is alos true..if i start my application first the Toolbox application won't run.
    I tried to install the Toolbox app on another machine and monitor a directory remotely...this doesn't work because you can't read or write to remote files from a servlet or JSP.
    I tried loading my application in the web apps directory of Apache 4.03 but it did not detect my application. I don't know how to configure the Tomcat customised by HP.
    How can i go about this problem? Is there a way of running two versions of Apache Tomcat on one machine?
    Thanks
    Parthiv

    This is the exception i get when i try to run my version of Apache Tomcat when the Toolbox is running: My application is set to port 80.
    Exception in thread "http-80-1" java.lang.IllegalMonitorStateException: current thread not owner
         at java.lang.Object.notifyAll(Native Method)
         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1216)
         at java.lang.Thread.run(Unknown Source)

  • How to download and install all drivers on my laptop..plz help

    how to download and install all drivers  on my laptop..plz helpthe pre installed OS was ubuntu but now i havve installed Windows 7 64 bit...i m not able to use internet through ethernet,my wifi is not working..and many such problems related to drivers.

    How did you post this? Download the drivers to a memory stick. See Paul_Tikannen's post here: http://h30434.www3.hp.com/t5/Notebook-Operating-Systems-and-Software/windows-7-drivers-for-hp-1000-1336TU-notebook/td-p/4852732

Maybe you are looking for