Computer Science 252
Problem Solving with Java

Spring 2016, The College of Saint Rose

Lecture 14: More Interfaces; Java Swing
Date: Tuesday, March 15, 2016


Agenda

Lecture 14 Assignment

Due at the start of class, Thursday, March 17.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to terescoj AT strose.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CSC 252 Lecture 14 Assignment, Mary Smith). We will discuss these questions at the start of class, so no late submissions are accepted.

Write a program MoveItAround.java that creates any graphical object on the canvas when it starts and moves that object one pixel left, right, up or down each time a key press event is received for the arrow key in that direction. You can and should use the HandlingArrowKeys example as a guide, but note that you will not want an equivalent of the keyDown variable here, as we want the object to move repeatedly if an arrow key is held down. (10 points)

Terminology

Examples