Applets do not have a main method. There is probably a way in your IDE to define whether to run it as an applet - which I presume you wish to run this as - or an application (I don't use Netbeans so...