CSC 120

HTML and Applets


Below you will fine nice tutorials for learning HTML for creating your own Web pages:

HTML:
NCSA HTML Tutorials
Writing HTML A tutorial for creating web pages from Maricopa Community Colleges.
HTML Primers
W3C Home Page: Final word on HTML and XHTML specs.

Note:You can examine the HTML source code of almost any page by choosing "Page Source" or "Source" under the "View" menu of your browser.

Below you will find links to applet writing tutorials and a great many examples of applets, some which which you can freely include on your Web pages:

Applet Tutorials:
Applet tutorials
Writing Applets tutorials from Sun Microsystems
Sample applets with source code
A great collection of Java Applets from Java Boutique

Here is the java code for our FirstApplet.java.

Here is the HTML file FirstApplet.html to display this applet.

Here is a short documentation for methods for a Graphics object.

Here is the java code for our DrawChairs.java.

Here is the HTML file DrawChairs.html to display this applet.

Homework: Here are two activities for you to sharpen your HTML and Applet writing skills:

  1. Create a Web page of your own. Make sure to include several links, an applet, and some fancy layout. You can modify the FirstApplet.java text colors, or design to create your own SecondApplet.java.

  2. Modify the applet DrawChairs to include a method for drawing tables. Your method should allow a table to be drawn anywhere and anysize. Place a table and a chair in your applet. You can peek at a solution here. You should compile and create an appropriate HTML file to imbed this applet (can modify FirstApplet.html).

NOTE: Refresh button on most browsers do not reload a recompiled applet class file. There are several ways around this problem. You can close and open your browser (this works with Firefox), or you can use on the command line
appletviewer FirstApplet.html
Notice that you need to point to the corresponding HTML file.