CS 161 Lab #1

Thursday, September 3rd

Goals:

This lab will familiarize you with the BlueJ interactive Java environment, and help you set BlueJ up for future work this semester. During the lab you will install BlueJ in your personal space on the Alexandria server so that you can access it from any PC on campus. You will then configure several settings, experiment with an existing project, and practice submitting your work electronically. Note: Internet Explorer was used to generate the screen shots in this lab. The process is the same if you use a different browser, though the pictures won't look exactly as shown.

Directions:

  1. First, make sure your shared drive on Alexandria has been mounted. If you can't find it, or haven't ever used your shared space, see this tip from ResNet for guidance.
  2. Next, we'll install BlueJ in your personal space. Open the BlueJ downloads page in a separate window and find the link for the Windows version of BlueJ, then follow these steps before returning to this page and starting to work with the Shapes project.
  3. Now let's download a project to experiment with: Click and save UPS_Shapes.zip onto your desktop. Depending upon how your computer has been configured, this should either appear as a compressed folder (below, left), an jZip archive (below center), or as a Filzip archive (below, right). The actual UPS_Shapes project is inside the compressed folder or archive, and we need to extract it before BlueJ can open the project. No matter what the downloaded file looks like on your desktop, double click it to get at its contents. If it was a compressed folder or jZip archive, you'll see the UPS_Shapes project inside it. Drag the UPS_Shapes project out onto the desktop. If it was a filzip archive, you'll see UPS_Shapes listed in the contents of the archive. Select it and click the "Extract" button at the top of the window. In either case, you should end up with a plain old UPS_Shapes folder on your desktop. (If this is the first time you've run filzip, it'll ask you if you want to register but you can choose not to. It'll also present a list of files it knows how to handle. Press "Associate" and continue.)

             

  4. If you didn't ask the installer to run BlueJ, double-click on the BlueJ icon (or use the Start Menu) to run the application. Go to the "Open Project..." menu item on the "Project" menu and navigate to the "UPS_Shapes" project in the file-selection dialog. If all goes well, you should end up with a project window like the one below.

  5. The gray stripes appear on the class icons because the classes haven't been compiled yet. We can't interact with the classes until they've compiled, so click on the "Compile" button on the left side of the screen to compile before proceeding. If something goes wrong, it's typically because either Java isn't properly installed on your machine, or BlueJ hasn't been configured properly and is having trouble finding the Java compiler. Holler if the compilation fails, and I'll help sort things out. If you're trying this on your own, there are installation instructions on the downloads page that should help.

  6. We'll do some more experimenting later, but for now, stick to the script: Double-click on the Circle class icon to open an editing window. It should look like the window shown below (except for a more recent date). Add your own name to the list of authors, after "David J. Barnes", then click Compile. (After making changes, we can't interact with the class again until it's been compiled.) After it compiles, close the editing window.

  7. For practice, you'll now submit this "modified" project electronically. In general, you won't submit anything during labs — this is just practice for when we start doing assignments. Before you can submit though, you need to modify some BlueJ settings: Select "Preferences..." form the "Tools" menu to bring up the preferences window (it's under the "BlueJ" menu on the Mac), then click on the "Extensions" tab. Fill in the fields as shown below, but with your own user name and UPS E-mail address in the first two fields, then click "OK".

  8. Select "Submit..." from the "Tools" menu to get the Submitter window shown below. (I expanded the window a bit so it was easier to see the contents.) Click the "Browse" button, select 161C from the list, then click the "Submit" button

  9. If all goes well, you should see the following output in a new window:

  10. If you use the wrong E-mail address, you'll see a failure message like the one shown here. Let me know if this happens and I'll try to help you sort things out.

If time permits, consider trying some of the following exercises:


Brad Richards, 2009