Results 1 to 2 of 2
  1. #1
    Bibin is offline Member
    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0

    Post Exception in thread "main" java.lang.NoSuchMethodError: main

    Java Code:
    import javax.swing.*;
    import java.awt.*;
    public class jtx extends JApplet
    {
    	JTextField f1;
    	JPasswordField f2;
    	public void init()
    	{
    		setLayout(new FlowLayout());
    		f1=new JTextField(20);
    		f2=new JPasswordField(20);
    		add(f1);
    		add(f2);
    	}
    }
    //<applet code=jtxtexp width=300 height=300></applet>
    Last edited by pbrockway2; 12-24-2011 at 09:34 AM. Reason: code tags added

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,048
    Blog Entries
    7
    Rep Power
    23

    Default Re: Exception in thread "main" java.lang.NoSuchMethodError: main

    An Applet (or JApplet) doesn't have a main( ... ) method and therefore can't be run as if it were an application.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Replies: 28
    Last Post: 03-16-2011, 08:06 PM
  2. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  3. Replies: 6
    Last Post: 07-16-2009, 03:30 PM
  4. Replies: 1
    Last Post: 07-16-2009, 10:35 AM
  5. Replies: 1
    Last Post: 08-07-2007, 07:10 AM

Posting Permissions

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