Computer Science 252
Problem Solving with Java

Fall 2015, The College of Saint Rose

Lecture 14: More Interfaces; Java Swing
Date: Tuesday, October 20, 2015


Agenda

Lecture 14 Assignment

Due at the start of class, Thursday, October 22.

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 , Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted.

  1. Which operations must be supported by an Objectdraw object in order for it to be draggable? (3 points)
  2. Write a Java interface called Draggable that includes those needed methods. (3 points)
  3. Suppose your WindowController class has an instance variable of type Draggable and its begin method assigns that variable to refer to some object that implements the Draggable interface. Write the onMousePress, onMouseDrag, and onMouseRelease methods to support dragging of that object. List any additional instance variables you'll need. (6 points)

Terminology

Examples