Published using Google Docs
CS20 Java GUI Unit
Updated automatically every 5 minutes

This doc is currently being replaced by separate assignments.  It is out of date.

Java Gui/Windows Programming

CSE2910 CSE Project C

Evaluation Guide: For this credit the following will serve as the skills breakdown:

For most assignments, the following marking scheme will apply

Extra Resources

The following links should be used after you have completed a few examples.


The Big Picture

The goal of this credit is to familiarize yourself with building GUI programs, first with an introduction to coding them entirely by hand and then quickly moving into building using the NetBeans GUI Builder.  Eventually I want to give you the ability to find and learn about whatever components you need to fulfill your own vision.

Begin by creating a new Project called GUI_Unit.  All coding for this credit should go into this project.

Activity

Learning Activity 1 - Learning the Background Code

Learning Activity 2 - Learning the Netbeans GUI Builder

GUI Calculator

Encryption Assignment

Quiz Program

Completion of the above will result in a mark of approx. 60% +- 10%

Rock Paper Scissors or PNZ GUI

Multi-Window Encryption

Completion of the above will result in a mark of approx. 80%

Activity 8 - Simple Game

Completion of the above will result in a mark of approx. 90% +- 10%

Omit of 2013/14: Learning Activity 1 - Learning the Paint method (in class activity)

Assignment 1 - Drawing Assignment (Speed Limit Sign and Bulls Eye)


Learning Activity  1 - Learning the Background Coding

Suggested Timeline: Less than 2 full class periods

Complete the code from the following TheNewBoston Videos but be sure to read the notes under each heading before playing the video.  

Do not forget to follow our good coding practices (sometimes the video does, other times, not so much).  One thing that you may forget is that class names must (and are the only thing that) START with a capital letter.

Learning Activity 2 - Using the Netbeans GUI Builder

Learn the builder using Netbeans own tutorials (2-3 classes)

Tutorial 1: Introduction to Java GUI Building (15 min)

After completing tutorial 1, you have the background necessary to complete most of assignment 1 (Simple Calculator).  You can choose to complete that assignment first before moving on to tutorial 2 if you wish.

Tutorial 2: GUI Building in NetBeans IDE (30 min) Some things in this tutorial will be review from the first one but it teaches you some new skills and explains more of what is happening behind the scenes.

Tutorial 3: Handling Images in a GUI Application Note: This tutorial is for the new NetBeans 7.4 (we have a 7.3 version) so not everything will work exactly the same but you should still get the key ideas.

Want more tutorials before continuing?  https://netbeans.org/kb/trails/matisse.html


Marked Assignment 1 - GUI Calculator

Suggested Timeline: 1 full class period

See the separate document.



Assignment 2 - GUIfy Encryption Assignment

Suggested Timeline: One full class period

Depending on your class, you may have already created an Encryption file that uses a simple Caesar Shift to encode a message.  Your task is to GUIfy* this code.  

*GUIfy is a trademarked term by Couprie Industries

Link to a Caeser Shift Demonstration

You may request a copy of the original Java code and then ask for a walk through if you need it.

This assignment simply wants you to take this code and make it work in a Windows environment.  Suggested components include:

Advanced Features:

Functionality - 80%

Look and Feel - 10%

Good Coding - 10%



Assignment 3 - Quiz Program (Using Other Swing Components)

Your goal is to build a small Quiz program that demonstrates at least 3 or 4 of the following components:

Need help, this page has a list of examples but they are not always easy to understand.  GUI Examples Index page - scroll down for the list.  The zetcode website could also help with many of them.

Requirements:

Advanced Features:

Evaluation


Assignment 4 (2 options)

Option 1: Rock, Paper, Scissors Game

NOTE : Ask your teacher for a mini-lesson on using Images.  If your teacher is too busy or does not care about you, make sure you have completed the Netbeans Tutorials 2 and 3 (higher up in this document) before working on this project.  If you have not done so, go do so now.

Depending your choice of projects in past credits, you may or may not have created a simple scanner based RPS game.  Not to worry, if you want it, the code is on the T:Drive.

Your goal is to create a PICTURE based RPS game.  Your player will click on a picture of one of either Rock, Paper or Scissors to choose it.  The computer will then randomly pick one and display its choice.

In some way you must keep score.

You must also include an exit button.

Step 1: Sketch out a design for your window.  You will need to set up space for the following::

Step 2: Layout the design of your JFrame

Step 3: Use the existing RPS code or write your own.  

Evaluation

Setting up the GUI        40%

Game Play                40%

Keeps Score                20%

Option 2: Master Mind (PNZ Game)

This option is only for those that successfully completed the PNZ Game in the Procedural Programming Credit.


Assignment 5 - Encryption Part 2 - A multi-window Program

Your goal is to create a multi-window version of the encryption program you created for assignment 4.  There are many ways of accomplishing this but I recommend running a main class that runs in the background with three separate JFrame classes to run each window.

Main Class

Its only job is to create the first window.  In larger, more realistic programs, it would be used to house global variables and lists that you need throughout the program.

First Window

Contains 5 things:

When the encryption button is pressed it checks the password.

The first window stays open until its X button is pressed, which should close the whole program.

Repeat for the Decrypt button.

Encrypt and Decrypt Windows

Note: To save time, you can open the window from the last assignment and File… Save As twice, then you just need to tweak the contents and layout.

Each Contain:

When the X button is pressed on these windows, ONLY that particular window should close.  


Assignment 6 - Simple Game

Options:

Your goal is to create a game that is simple enough that you can complete it in 2 or 3 classes.  I recommend you create a 1 player game where the player tries to ‘beat’ the computer.

Base Requirements: 60%

User Interface: 20%

Look and Feel: 20%

There is a folder on the T:drive with pictures of all cards and all sides of a die.

Talk to Couprie before beginning so that you do not delve into too complex of an assignment.


Assignment 9 - Final Java Project

Talk to Couprie before continuing to discuss the final project.  Those of you interested in doing a  MAJOR java project, can do so for a complete (additional) credit.

You can also attempt this Final Project in groups.  BUT you will need to plan things thoroughly and properly, assigning certain functions/classes to each person.

Notes to Couprie:

2E. Other ideas: Adapting Zetcode activities to work with the builder?