We can then run the applet by either opening the HTML file in any java enabled web browser or using the applet viewer that comes with JRE with the command "appletviewer. HelloWorld.class in the applet part of the HTML file. Applets doesn't have main class so we go around this error by calling the java class generated by command "javac HelloWorld.java" (as in the above example by anonymous user) ie. This will provides errors saying missing main class. You can't run an applet using the command "java HelloWorld" (as in the example given by anonymous user). I quote, "Now when you compile the program through the command prompt as javac filename.java and run using java filename.". Talk about the portability which is what java really is!Īlso the anonymous user has made an error in his answer. jar file in any system that has a working JRE. The good thing is you can run your application by double clicking your. Once you create an desktop application in JSwings, you can convert your entire application to a. Sure you can but its much more efficient to go for Java Swings. This doesn't mean you can't make a desktop application using applet. An applet not only has a java part but also an HTML part. An applet is a Java program that runs in a java enabled Web browser or an applet viewer that comes with JRE. An applet is usually used for Web based application rather than a Desktop applications. I would rather go for Java Swings or even Java AWT if not Swings. I frankly would not prefer applets for developing a desktop application in Java using NetBeans.