Skip to main content.

Monday, February 13, 2006
Due: Monday, February 27, 2006 - 10:00PM

Project Proposal Rough Draft

[15 points] By this date, I would like to see a rough draft of your project proposal/design. (See Project) The spokesperson of each group should email me your group's work.

Programming Assignment

[80 points] Write a program that lets users interactively design pie and bar charts. Use appropriate components to allow users to enter labels and double values for data items and then update the chart when the user clicks an "Add Item" button. The user should be able to switch somehow between viewing a bar chart and a pie chart. To get you started, I am already providing classes that do all the drawing of the two types of charts, given a series of data value inputs. The PieChartTester and BarChartTester classes have short main methods that will allow you to preview the behavior of the ChartComponent classes.

How to import the files for this assignment into your Eclipse workspace:

  1. Download this JAR (Java archive) file: hw05/hw05charts.jar (onto your desktop, not into your Eclipse workspace folder)
  2. Create a new Eclipse project called "hw05charts".
  3. Select the "hw05charts" project and choose "Import" from the File menu.
  4. Choose "Archive file" as the import source and go to the next screen.
  5. Browse to select the hw05charts.jar file at the top of the dialog.
  6. At the bottom, make sure the hw05charts project is set as the "Into folder".
  7. Click "Finish".

If you are feeling more creative, here are some additional features you may consider adding to your program:

Hints and resources:

The Swing trail of the Java Tutorial may be a good thing to browse to become familiar with the GUI components and their use: http://java.sun.com/docs/books/tutorial/uiswing/index.html

For providing the user the ability to switch between pie and bar charts, you may consider using a CardLayout manager for the JPanel that contains the chart components: http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html. An alternative possibility would be a tabbed pane: http://java.sun.com/docs/books/tutorial/uiswing/components/tabbedpane.html

What to submit

Your completed source code files should be turned into the proper submit folder (submit05) by the deadline. Submit all source code files that are necessary to run your program, including the ones I provide you, even if you don't modify them.

You must also submit a readme.txt file describing the features of your program. It should include a discussion of how a user is to use the program as well as discussion of technical code details on how you may have implemented some of the more interesting features.

Note: All source code that you produce must conform to the following style guide, adapted from the textbook's Appendix A: Java Programming Style Guide. Be sure to include appropriate comments in your code!!!