eHow launches Android app: Get the best of eHow on the go.

How To

How to Write A Java Applet

Member
By nancys123
User-Submitted Article
(1 Ratings)
Alarm Clock Applet
Alarm Clock 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.

Difficulty: Moderate
Instructions

Things You'll Need:

  • Java IDE
  1. Step 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. Step 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. Step 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. Step 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)

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

Comments  

jhkcpa said

Flag This Comment

on 10/6/2009 Great article on how to write a Java applet. 5*

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Computers
Alexia Petrakos,

Meet Alexia Petrakos eHow's Computers Expert.

Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics