CS 3331 - Advanced Object-Oriented Programming HOMEWORK 6: GUI PROGRAMMING (File $Date: 2009/11/16 18:31:26 $) Due: November 25, 2009 (NO GRACE PERIOD!) This is an extra-credit homework assignment. The purpose of this homework is to be able to write a simple GUI program in Java by using GUI frameworks such as Swing and AWT. 1. (50 points) Write a GUI application named ConnectPoint that allow one to create a set of points (incrementally) and connect them by drawing a straight line between each pair of the points (see Figure 1 below). +-------------------+ +-------------------+ | | | | | o | | o---o | | | | | | | | | | | | | +-------------------+ +-------------------+ | No. of points: 1 | | No. of points: 2 | +-------------------+ +-------------------+ +-------------------+ +-------------------+ | | | | | o---o | | o---o | | | / | | | X | | | o | | o---o | | | | | +-------------------+ +-------------------+ | No. of points: 3 | | No. of points: 4 | +-------------------+ +-------------------+ Figure 1. Sample screens of ConnectPoint The key requirements of the application include: R1. When a user clicks a mouse button at a position in the screen, a new point should be created at that position. R2. A straight line should be drawn from the new point to every existing point. R3. The number of points should be displayed all the time. R4. The application should provide a menu item in the menu bar and a tool icon in the tool bar for starting a new game. TESTING Your code should compile, and run correctly under Java 1.4.2 or later version. WHAT AND HOW TO TURN IN Submit your programs through the Assignment Submission page found in the Homework section of the course website. The page will ask you to zip, jar, or tar your programs, and upload a single file. The zip (jar or tar) file should include only a single directory named YourFirstNameLastName which contains all your source code files and other support files needed to compile and run your program. DO NOT INCLUDE BYTECODE (.class) FILES OR HTML FILES. You should turn in your programs before the class time on the due date. GRADING You will be graded, in part, on how clear your code is. Excessively long code will be penalized: don't repeat code in multiple places. Your code should be well documented with Javadoc and sensibly indented so it is easy to read; regardless of their visibility, all classes, interfaces, fields, and methods must be documented with Javadoc comments. Be sure your name is in the comments in your code.