Computer Science 252
Problem Solving with Java
Spring 2016, The College of Saint Rose
Agenda
Go way back in time to an example such as Scribble or SpiralLines and add at least 2 Java Swing components. For example, you might choose to add a "Clear" JButton that will clear the canvas, and a JComboBox select from among several colors to use for the next created scribble.
Please demonstrate your program or submit only the file you modify by email before you leave class. Email submissions should use a meaningful subject line, clearly indicating the course number and assignment name.
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