This document introduces Java Applet development in Netbeans, including creating Applet class and HTML document, running Applet in Netbeans, etc.
This Indonesian-language guide explains how to create and run Java Applets in the NetBeans IDE. It describes the two basic steps - developing an Applet class based on the java.applet package and creating an associated HTML document - and provides template code for both the Applet class and the HTML embedding page.
Step-by-step instructions cover creating an applet file via File > New File (Java category, Applet/JApplet file type), compiling it to a .class file, and running it to generate the HTML page. Worked examples include Applet1 (drawing a red circle), Applet2 (a moving ball using threads and the Runnable interface), Applet3 (random circles drawn on mouse clicks), and Applet3.1, which adds double-buffering so previous circles remain. The guide also explains how to change the applet size by editing the HTML file in the src folder rather than the build folder, where it is overwritten on each run.
First create an Applet class, then create an HTML document associated with that Applet class to run it at a set size on a web page.
Open File > New File, choose the Java category, and select the Applet or JApplet file type; the file is saved in the src folder.
The HTML file in the build folder is overwritten every time the file is run. Copy it to the src folder, edit it there, and rebuild so it is copied back to build.
It implements the Runnable interface, declares a Thread object, starts the thread in start(), and moves the ball inside the run() function with repaint() calls.