Tutorial 2

Due May 17 at 6 am.

For this tutorial, you are to create two, separate, NetBeans projects. Each project will implement one of the Programming Activity examples from the book. I have made some minor changes to the files, so be sure to download the copies from this page and not the ones from the book's CD.

NetBeans Project One

Download these three files to a directory on your local computer. Name the directory ActivityOne.

Create a NetBeans project from these existing source files. I have created a page with screen shots that will step you through the process: Creating a NetBeans Project from Existing Sources

Only make changes to the workWithDates method. Follow the instructions in the comments. After you add implement a step, uncomment the animate call that follows it, then run the program. Each time you run it, another step in the process will be animated. Repeat this until you have added all the features.

The last feature will cause your application to crash. It is supposed to do that.

NetBeans Project Two

Download this file to a directory on your local computer. Name the directory ActivityTwo.

Create a NetBeans project from this existing source.

All the changes should be made in the main method. There are four features to implement. Follow the instructions in the comments.

Two of the features use the Java console, like the first homework assignment. Two of the features use JOptionPane to interact with the user, like the first part of this tutorial.

Working with the console is what you expect if you are using NetBeans 6. An output window will open at the bottom of NetBeans, where you can enter input and see output.

In NetBeans 5.5, there are some rules that must be followed.

  1. In NetBeans 5.5, only use println when asking for input. For example, always do something like
    System.out.println("Enter your name >");
    If you don't do this, then you will not see the prompt before you are asked to enter input.
  2. In NetBeans 5.5, you enter input in a special input box at the bottom of the screen. Enter the input and hit enter.

Submitting the Tutorial

To submit the tutorial, perform a Clean and Build on for both projects. Be sure that you have followed the instructions for adding .java files to the JAR file before you do this step. If you are not sure, then review the steps in the Creating a NetBeans Project from Existing Sources page; it is in the section on Submitting Assignments.

You can verify that the JAR files are correct by clicking on the Files tab in NetBeans; open the project folder; open the dist folder; expand the JAR file. You should see the .class and .java files in the JAR. If you only see the .class files, then you need to review the instructions for adding the .java files. This is the same for NetBeans 5.5 and 6.

Using the operating system, not NetBeans, vavigate to each of the dist directories for each project and upload both JAR files to me: Submit Assignment. You will need to upload each JAR file separately.