Java Instructions
To write your own Java applets you need to download and install two packages from the Oracle Website: the latest Java SE Development Kit (currently 7), and its documentation. It has the "command-line development tools that are useful for developing applets". The download and installation instructions are fairly easy to follow, but you may find it convenient for command-line work if the folder is in your main directory (I use folders c:\jdk1.3 and c:\jdk1.6).
To work with Java you open the Command Prompt (what used to be DOS). You work from the binary directory (c:\jdk1.6\bin in my case) - this is where "javac" (the Java complier) and "appletviewer" are located. You need to create a folder here to hold your programs (I use a short name like "rr" to cut down on typing). Next you want to put two files into your folder. The first is a small html file that appletviewer uses to access the Java class file. Do a "save as" to put it in your folder as c:\jdk1.6\bin\rr\av.txt. The second is the Java source file. Do another save as to put it in your folder as c:\jdk1.6\bin\rr\fplw.txt.
From this point on you use the Command Line Interpreter (from c:\jdk1.6\bin). First change the extensions on your two files: "ren rr\av.txt av.html" and "ren rr\fplw.txt fplw.java". Next issue the command "javac rr\fplw.java". This will cause the compiler to create "fplw.class", the file that "av.html" looks for. Finally issue the command "appletviewer rr\av.html", and something good should happen.
Next make your own version of the program. Issue the command "edit rr\fplw.java". Go down to line 38 and change "green" to "magenta". Save the program, then compile it ("javac rr\fplw.java"). Now when you run appletviewer you see the result of your handiwork. Congratulations!
One obvious question: how does one know that Java recognizes "magenta"? The simple answer: that's what the documentation is for. The next obvious question: and how does one do that? The answer is anything but simple. You have been working in the "bin" folder. Explore and go down to the "docs" folder. Open "docs" then open "api". Double-click on "overview-frame". Click on "java.awt". Click on "Paint" (under Interfaces). Click on "Color" (under Implementing Classes). There you find the colors Java recognizes.
The easiest way to learn how to do something (like using buttons) is to look at the source code of a program that does what you want to do. That is what my Java source code is for.