CSE 115 - Fall 2006 - Banner
   CSE 115 - Fall 2006 - Introduction to Computer Science for Majors I
CSE 115 - Fall 2006 - Left Navigation CSE 115 - Fall 2006 - Lab 8

Lab 9

Introduction

Congratulations! If you're reading this, it means you've decided to stick it out to the very end. You've survived painters, cells, swimming fish and more bouncing shapes than anyone cares to count. Up until now, we've told you what to do -- but times they are a changin'. It's time for you the CSE115 students to stand up and be counted. To say, "We are sick of the monarchy! We are tired of having projects that all look the same! We are not just numbers! NO! We are programmers!" Rise up little programmers and read on...


Extra Credit

To encourage you to be creative we are holding a contest for lab 9 submissions. The grand prize is 10 points extra credit (up to a maximum of 100 total points) on your exam average!

There are 2 categories: 1) Overall best GUI and 2) Most creative. For the most creative category, you must write a creative story about your GUI, include it as story.txt in the zip file you submit.

Second place contestants will receive 8 points extra credit while third place gets 5 points extra credit on their exam average.

The competition is open across all sections of the course.

To compete in this competition, you should decide whether you want to be in the creative competition or the technical competition, and complete your Lab 9 program.

After the labs are graded, those submissions that have successfully completed all the requirements of the lab will be eligible to be judged.

To be judged, you will be required to present your program and its technical or creative merit in front of the Fall 2006 contest judging panel. A sign-up sheet for presentations will be available - tentative date TBA.

Good luck to all!


New Concepts Covered

The following are the new concepts covered in this lab.

  • GUIs
  • Graphical Containment
  • Layout Management
  • Using the cse115 graphics package
  • Using Java Swing graphics
  • Creating projects in eclipse
  • Applications using the main method

Assignment Specification

Here's your chance to be creative. The assignment specification is simple: create a "kick ass" graphical user interface that accomplishes some minor task. Use your imagination, artistic ability, and programming skill to make something that wows your friends and the TAs. Think moving shapes, changing colors, and 3-D rotating fractal landscapes. We've shown you how to create color changing and crazily swimming fish. What will you make?

To provide some direction we require the following elements:

  • Your GUI must be an application (not an applet).
  • You must have an cse115.graphics.DrawingCanvas
  • There must be an cse115.graphics element on the drawing panel that at some point in the program "animates" (ie - moves using a cse115.utilities.Timer).
  • You must use at least 2 different components from the list below. All of these classes are located in the javax.swing package. This means you should have at least two different components on the GUI - you can have more. The only elements that count for this requirement are the ones listed below. Remember, each must do something useful.
    • JButton
    • JCheckBox
    • JColorChooser
    • JComboBox
    • JFileChooser
    • JList
    • JProgressBar
    • JRadioButton
    • JSlider
    • JSpinner
    • JToggleButton
    • JMenu & JMenuBar & JMenuItem/JComboBoxMenuItem/JRadioButtonMenuItem
      • These all count as one component
    • JPopupMenu (Can not repeat functionality of JMenu if used)
    • JFormattedTextField - Must do something useful with the inputted text
    • JPasswordField - Must do something useful with the inputted text
    • JTextArea - Must do something useful with the inputted text
    • JTextField - Must do something useful with the inputted text
    • JTextPane - Must do something useful with the inputted text

    As a final option, you can make your drawing canvas or graphic react to mouse clicks.

By creating a GUI we hope that you will get a solid grasp of creating graphical programs using a mix of the native swing graphical components and the graphics framework we have provided for you. Use your creativity!


Helpful Hints

Make sure to do the reading listed below. Don't hesitate to also examine the fishBowl code (or any of the code from the other labs) in the Classlibs.jar file.

Read the Classes' Public Interfaces section below.

Before coding, you should draw a picture of what you want your GUI to look like. From this, determine which graphical components you will need and which graphical containers you will need to format them. Also, you should draw yourself a class hierarchy diagram to understand which objects have to communicate and in what way. If you know exactly what you are doing before you start coding, you should have no problem writing it.


Preparatory work

In order to be able to carry out the tasks required during your lab session, you must come prepared. Do the following before coming to your lab session:

Reading

Review the graphics code (and class notes) that were discussed in class.


Lab tasks

At your lab session your teaching assistant will briefly discuss how to carry out each of the tasks below. She or he will also be available to answer questions you might have. You must carry out each of the following tasks.

Create a new project in Eclipse

This time, there's no skeleton. You must create your own project from scratch. Here are the steps you need to follow:

  1. You're going to be developing your code in a project called "Lab9." To create a new Java project in Eclipse, under the File menu, select New -> Project.

  2. Select "Java Project" and click Next. Name your project "Lab9." If you see that the Java compiler being used is 1.4 in the "JDK Compliance" section, click the "Use a project specific compliance" button and select "5.0" from the dropdown menu. Then click Finish. You will see the new project pop up in the Package Explorer.


  3. Now right click on the project, and select New -> Package.
  4. Name the package "lab9." Then click Finish. All of your work will be in the lab9 package.



    Congratulations: your project, along with a new package, is officially created! But, in order for you to use cse115-specific libraries, such as the cse115 packages, you must explicitly tell your project to include the Classlibs.jar archive. Steps 5-8 will explain this process.

  5. Right-click on your project folder and select "Properties."
  6. In the left pane of the "Properties for Lab9" window, select "Java Build Path."
  7. In the right pane of the "Properties for Lab9" window, click the "Libraries" tab.
  8. Click "Add External JARs..." This is where the magic happens. Navigate to /projects/CSE115/Classlibs/Fall2006/ in the JAR Selection dialog and double click Classlibs.jar. Click OK on the Properties window. You're done!

Lab Design

Once again you are required to design your solution to the lab. Create a file called Lab9.dia in the Lab9project and submit it with your project's jar file.

Use your picture of your GUI and the Classes' Public Interfaces to decide what has been written and what you need to create.

Once again, remember to design and code iteratively


Classes' Public Interfaces

Really the only stuff you need to read are the for the Classlibs located on the Resources page and the main Java API docs, once again linked off of the Resources page.


Submission Directions

After you are finished writing your code, jar the Lab9 project and submit the resulting jar file, Lab9.jar.

You must follow all directions about filenames exactly, otherwise your work will not be graded.

Now you are ready to submit your work. Use the electronic submission program that corresponds to your recitation.


Due Dates

Due 11:59:59pm on the day before your recitation meets during the week of November 13th.

 

CSE 115 - Fall 2006 - Footer

 

 
Last modified: Fri Oct 20 08:26:32 2006