Auf Thema antworten

Nachdem ich den rat bekommen habe nochmal von vorne zu beginnen - und ich dies gerade mache (wohl eher versuche...)


stoße ich seltsamer weiße schon jetzt auf folgenden Interpreter fehler:

java.lang.NoSuchMethodError: main

Exception in thread "main"


code:

[code=Java]import java.applet.*;

import java.awt.*;


public class Main extends Applet implements Runnable

{

   Thread th;


   public void init()

   {


   }

  

   public void start()

   {

     th = new Thread(this);

     th.start();

   }

  

   public void stop()

   {


   }

  

   public void destroy()

   {


   }

  

   public void run()

   {

     Thread.currentThread().setPriority(Thread.MIN_PRIORITY);


     while(true)

     {

       try

       {

         repaint();

        

         th.sleep(20);

       }

      

       catch(InterruptedException ex)

       {

         //do nothing

       }

       Thread.currentThread().setPriority(Thread.MAX_PRIORITY);

     }

   }

  

   public void paint(Graphics g)

   {

     g.setColor(Color.yellow);    

     g.drawRect(0, 0, 300, 300);

   }

}[/code]


irgendwie kenn ich mich jetzt gar nicht mehr aus oO

entweder ich verblöde oder das programm mag mich nicht (ich vermute leider ersteres)



Oben