[Image]

Dates

creates a calendar database, with a single String for each day of an entire year.  Events area added by making the string longer.

At the beginning, [Make Year] creates all the dates for an entire year.  It must keep track of the days of the week, as well as the correct number of days in each month.

The user adds new events by typing the description in the Event TextField, and then clicking on a date.  For recurring events (e.g. meetings, sports practice, etc) the user clicks on several dates.

The dates can be saved and loaded in a text-file named "Dates.txt".

EasyApp

The Dates class extends EasyApp.  The EasyApp class contains two sets of useful methods:

  1. IBIO simple input and output methods
  2. addComponent methods for creating components

addComponent

There is an add.. method for each normal AWT component:

   Button, TextField, TextArea, Label, List, Choice, Checkbox

EasyApp uses a null Layout manager, so each component is placed and sized directly in the add.. method.  Some methods require a String as the first component - this will be displayed by the component.  They all end with the four parameters left, top, width, height.

The add.. methods also execute and addListener(this) command, so the control actions are automatically connected to the actionPerformed and itemStateChanged methods.  The application must override these event handlers.

Program Structure

The basic structure of an EasyApp program is contains the following sections:

  1. Header - import commands, class header, main method
     
  2. Components and Variables - create the components using addComponent methods, and declare variables
     
  3. Constructor - change appearance of components, initialize variables
     
  4. Event Handlers - actionPerformed and itemStateChanged handlers
     
  5. Paint Method - draws graphics in the window
     
  6. Further Methods - methods to perform algorithms like saving and loading files, calculations, etc.  This generally includes a method for each Button, to be called by the actionPerformed method
     

Comments

The use of a null layout manager reduces cross-platform flexibility, as standard font sizes are not the same in variaous OS's.  However, the direct control of the placement of components is probably a simpler concept for beginning programmers.

All the components are standard AWT components.  All standard methods function as normal, including adding further listeners.

Using EasyApp is not significantly different than using a GUI IDE like NetBeans, but in EasyApp the students must do a bit more work, and will hopefully learn a bit more.