Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java Thread error plz help me

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Thanked 0 Times in 0 Posts

    Default Java Thread error plz help me

    Hi frnds i am showing u my simple thread example but it shows error Exception in thread "main" java.langNo such method Error:main

    import java.applet.*;
    import java.awt.*;
    public class Myapplet extends Applet{
    	String str;
    	public void init(){
    		str = "This is my first applet";
    	public void paint(Graphics g){
    		g.drawString(str, 50,50);
    Last edited by copeg; July 12th, 2010 at 09:58 AM.

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: Java Thread error plz help me

    Seems you may be trying to run a applet as an application, and since there is no main method you receive this error. You should use something like appletviewer to view and test applets. There are quite a few tutorials out there to do so, in which case I'd recommend googling something like 'appletviewer tutorial'.

Similar Threads

  1. Replies: 3
    Last Post: April 26th, 2011, 02:51 AM
  2. Java error
    By d7o0om in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 12th, 2010, 08:14 AM
  3. java.lang.numberformatexception error
    By natalie in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 19th, 2010, 04:16 AM
  4. an error message while runnung java
    By sravan_kumar343 in forum Java Theory & Questions
    Replies: 1
    Last Post: January 25th, 2010, 10:19 AM
  5. Replies: 4
    Last Post: April 29th, 2009, 10:53 AM