Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Lightbulb Exception in thread main java.lang.nosuchmethoderror main

    Whenever m compiling no error is showed but while executing error occurs(nosuchmethoderror)
    If i m not wrong then in applet Main method is not declared
    Please guide



    import java.awt.*;
    import java.applet.*;
    /*
    <applet code="ColorDemo" width=300 hieght=200>
    </applet>
    */

    public class ColorDemo extends Applet
    {
    public void paint(Graphics g)
    {
    Color c1 = new Color(255,100,100);
    Color c2 = new Color(100,255,100);
    Color c3 = new Color(100,255,255);

    g.setColor(c1);
    g.drawLine(0,0,100,100);
    g.drawLine(0,25,150,200);



    g.setColor(c2);
    g.drawLine(40,50,200,100);
    g.drawLine(75,90,400,400);


    g.setColor(c3);
    g.drawLine(200,100,300,500);
    g.drawLine(231,132,123,345);



    g.setColor(Color.red);
    g.drawOval(10,10,100,100);
    g.fillOval(50,45,50,200);


    g.setColor(Color.blue);
    g.drawOval(10,10,100,100);
    g.drawRect(50,45,50,200);



    g.setColor(Color.cyan);
    g.fillRect(10,10,100,100);
    g.drawRect(50,45,50,200);



    }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Exception in thread main java.lang.nosuchmethoderror main

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,546
    Rep Power
    23

    Default Re: Exception in thread main java.lang.nosuchmethoderror main

    You don't show the full text of the error message. What did you leave out?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Exception in thread main java.lang.nosuchmethoderror main

    Didn't mention how he attempted to execute the class either.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 6
    Last Post: 01-21-2012, 05:59 AM
  2. Replies: 1
    Last Post: 12-24-2011, 08:45 AM
  3. Replies: 1
    Last Post: 11-23-2011, 05:52 AM
  4. Replies: 28
    Last Post: 03-16-2011, 07:06 PM
  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
  •