Results 1 to 5 of 5
  1. #1
    marco is offline Member
    Join Date
    Jul 2007
    Posts
    23
    Rep Power
    0

    Default error with JCreator

    man JCreator looks nice and is the best IDE i have seen yet, but when i compile applets i ALWAYS get a "Exception in thread "main" java.lang.NoSucHMethodError: main" i know it should work here is the applet template i use:


    // The "Applet1" class.
    import java.applet.*;
    import java.awt.*;

    public class Applet1 extends Applet
    {


    public void init ()
    {
    setBackground (Color.black);
    } // init method


    public void paint (Graphics g)
    {

    } // paint method
    } // Applet1 class


    the code is all there - dunno why it doesnt work tho

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Hi,

    I am not using JCreator for a long time. But the error look familiar to me. I think JCreator tries to execute your class as a java application, not a java applet. For that purpose, it tries to find a main method but can not find it and gives this error.

    Create a new Java Applet project and add this class to your new project or try changing runtime details (somehow select to run it as an applet instead of application if it is possible) from your project properties.

  3. #3
    Join Date
    Jun 2007
    Posts
    9
    Rep Power
    0

    Default

    I think you may have not create the html file and my kind advice is to use netbeans to run java...

  4. #4
    mystified is offline Member
    Join Date
    Sep 2008
    Posts
    21
    Rep Power
    0

    Default

    I had a similar error with jcreator..

    I saved the filename with a different name from the class name.. It worked when I rectified it.. Try maybe..

  5. #5
    AZMichael is offline Member
    Join Date
    Jan 2008
    Posts
    16
    Rep Power
    0

    Default

    You can create an easy html file, addit to your project and run from the html, and it loads the applet viewer, no prob.

    Alternatively, and even easier:

    go to Project (on menu) ->Project Settings ->JDK tools tab -> and for select tool type, choose Run Applet from the drop-down list

Similar Threads

  1. Applet with JCreator
    By baltimore in forum Java Applets
    Replies: 2
    Last Post: 04-18-2009, 01:40 PM
  2. About using jcreator
    By yuchuang in forum JCreator
    Replies: 4
    Last Post: 11-29-2008, 09:29 PM
  3. Replies: 1
    Last Post: 11-07-2007, 03:17 PM
  4. Executable Application, use JCreator
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:03 PM
  5. compilation error with Jcreator
    By Heather in forum JCreator
    Replies: 2
    Last Post: 06-30-2007, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •