Course web page: Introduction to Computer Science for majors II James Tam Return to the course web page

CPSC 219: Mini-Assignment #4

Due Thur Mar 31 at 4 PM

Text only connections such as Putty won't allow you to run programs that employ graphical user interfaces. If you have been working at home to complete assignments but haven't installed JDK on your computer then you might want to [map your UNIX account] to a drive on your computer.You can then access all the files on your computer science account directly from your home computer and use whatever editor that you wish. If you open up a remote connection using Putty then you can still compile your programs but it will be with the CPSC compilers. Finally to run your programs you can run 'Java' locally using JRE (unlike the JDK which includes the compiler you don't have to worry about setting the classpath). Open up a command line on your home computer 'cmd' and use it to navigate to where you have your GUI code on your CPSC account. (Don't forget to change drives - the drive letter will be whatever letter that you used when you initially mapped a drive to your UNIX account). When you type 'java Driver' (or whatever the name of starting class is) your GUI will be run locally on your computer.

New Concepts to be applied for the assignment

Overview

Everyone starts with a grade point of zero for this assignment. Implementing each of the features below completely and correctly will award you 1.0 grade points (i.e. implementing all four features will result in a grade point of 4.0 being awarded).

Figure 1: Program initially run, JFrame contains a JButton with default text

Figure 2: Button pressed: the text of the button changes to a non-default value

Figure 3: Button pressed: a new  JFrame popup (containing the same non-default text from the button) appears for each press

Figure 4: Clicking on the close window control (top right of the JFrame) will 'dispose' of the control (rather than default 'hide' behavior)

External libraries that can be used

Unlike the other assignments you will make extensive use of the pre-created Java libraries developed by Sun/Oracle for graphical components (e.g., java.awt., javax.swing), event handling (e.g., java.awt.event) .

Points to keep in mind:

  1. Due time: All assignments are due at 4 PM on the due dates listed on the course web page.  Late assignments or components of assignments will not be accepted for marking without approval for an extension beforehand. What you have submitted in D2L as of the due date is what will be marked.
  2. Extensions may be granted for reasonable cases by the course instructor with the receipt of the appropriate documentation (e.g., a doctor's note). Typical examples of reasonable cases for an extension include: illness or a death in the family. Cases where extensions will not be granted include situations that are typical of student life: having multiple due dates, work commitments etc. Tutorial instructors (TA's) will not be able to provide extension on their own and must receive permission from the course instructor first. (Note: Forgetting to hand your assignment or a component of your assignment in does not constitute a sufficient reason for handing your assignment late).
  3. Method of submission: You are to submit your assignment using D2L [help link]. Make sure that you [check the contents of your submitted files] (e.g., is the file okay or was it corrupted, is it the correct version etc.). It's your responsibility to do this! (Make sure that your submit your assignment with enough time before it comes due for you to do a check).
  4. Identifying information: All assignments should include contact information (full name and student ID number) at the very top of your program in the class where the 'main()' function/method resides.
  5. Collaboration: Assignments must reflect individual work, group work is not allowed in this class nor can you copy the work of others.  For more detailed information as to what constitutes academic misconduct (i.e., cheating) for this course please read the following [link].
  6. Execution: programs must run on the computer science network.  If you write you code in the lab and work remotely using a remote login program such as Putty or SSH. If you choose to install Java on your own computer then it is your responsibility to ensure that your program will run properly here. It's not recommended that you use an IDE for writing your programs but if you use one then make sure that you submit your program in the form of individual text ".java" files (one for each class that you define).
  7. Source code: in order to get any credit for your work you must submit all relevant dot-java files for the assignment (e.g., Driver.java). If you only submit your byte code files (e.g. Driver.class) then you will not be awarded any credit.

D2L configuration for this course