You need to run a program inside a web browser. Access to local resources (such as files on the local machine) are not required.
Both Input with Button and Input with TextField are simple examples of applets. What they don't show is the applet tag which must be included in the HTML file which contains the applet. Here is the tag from the page displaying the button example.
<APPLET WIDTH="154" HEIGHT="129" CODEBASE="applets/" CODE="Patterns.Button.ButtonEx.class"> </APPLET>Note that the example below uses javax.swing.JApplet, and that the online applet currently uses java.applet.Applet. If you want to use the enhanced swing capabilities then refer to the Applet lab, here.
package <PackageName>; import javax.swing.JApplet; public class <ClassName> extends JApplet { public void init() { <Code To Initialize Applet>} public void start() { <Code To Make Applet Start Doing Its Job>} public void stop() { <Code To Temporarily Stop Applet When It's Not Viewable>} public void destroy() { <Code To Execute When Applet Is Permanently Stopped>} }
Applet tags required in the HTML file where the applet should appear:
<APPLET WIDTH="<width in pixels>" HEIGHT="<height in pixels>" CODEBASE="<location of the applet's package relative to this HTML file" CODE="<PackageName>.<ClassName>.class"> </APPLET>