How to Write A Java Applet
Because Java is platform independent, Java applets are common programs that run on web pages. With a little programming experience and practice, they are fairly easy to write.
Instructions
-
-
1
First you need to decide on what type of program you want to write. Will it be a game? a utility? I have two different examples on my web page: http://www.horsesnw.com One is a common program assignment for Java classes: Breakout. The other is a timer program I wrote to keep me from burning cookies when I'm working on the computer. Check out some of the Google ad links from my web page for some ideas on types of programs to write
-
2
After you decide on the Applet you will need to plan out the program and name the variables to be used, decide on the type of action listener(s) (mouse / keyboard) and implement runnable so your Applet will continue to run until you stop it.
-
-
3
The minimum part of the Applet: You will want to extend Applet and immplement runnable and your action listener. You will need to go to the Java API to see which methods you will have to write for each of these classes.
-
4
After you have written the Applet, have your friends test it out and debug / add explanations if necessary.
Applet in picture is located at : http://www.horsesnw.com/java/alarm_index.htm (my site)
-
1
Tips & Warnings
Keep practicing. There are more ways than one to properly write a program
Start off with simple applets as you are learning then add complexity as you build understanding.
Buy Java books from Amazon.com (using the Associates links on my web page)
Do not plagiarize other peoples programs or parts of programs - always give credit to the program author
Resources
- Photo Credit http://www.horsesnw.com/java/alarm_index.htm