M/F 2:30-3:20   
in Philips 101

CS 1130: Transition to OO Programming

Spring 2015

Part 2. More on OO Programming Part 4. Programming Style

Module 2, Part 3

Applications & Applets

In this part, we show how you can create applications that run outside of DrJava, like software on your computer normally does.


Contents

1. Applications

Reading: Reading: Gries/Gries, Sec. 16.1, pp. 435–436.

Comments: Make a Java program into an application by declaring a static procedure main, with one parameter, of type String[] in some class. You do not need an IDE to execute an application. Just call the method main


2. Creating a Stand-Alone Application

Reading: Gries/Gries, Sec. 16.2, pp. 436–437.

Comments: This topic is not required in CS1130. You can make an application even easier to use by putting it in a jar file. Then, just double-click its icon to execute the application (i.e. to call its method main). This is easy to do.


3. Applets

Reading: Gries/Gries, Sec. 16.3, pp. 438–441; Sec. 16.4, pp. 441–444.

Comments: This topic is not required in CS1130. An applet is a subclass of Java API class Applet or JApplet. An applet is meant to be embedded in an HTML web page. Before the rise of Flash and Javascript (which despite the name, is a completely unrelated language), it was the primary way of making interactive web applications. Now it is rarely used.

Sec. 16.3 tells you about inherited (from Applet or JApplet) methods that can be used to control execution when the applet is running on the web. Sec. 16.4 then tells you how to write an HTML page that contains the applet.