Labtest04

Topic of Labtest 04

this information was conveyed during lecture and is being provided here in written form.

  • Understanding how GUIs are launched (instantiation of JFrame on the Event Dispatching Thread)
  • Understanding how listeners work, installing listeners
  • Understanding how GUIs draw themselves (delegation to each component's drawComponent method)
  • Background material: the set of classes that support L15App1 and L15App2

Sample tasks
  • Modify GreenEllipsePanel so that it draws some other shape (scaled to its available dimensions; modify the statements within the paintComponent method)
  • Modify the body of a method in a listener class (at present, the bodies of all of the methods just print out event information); for instance, use the MouseEvent API to determine information about the mouse event, such as using methods to accesses information about the number of mouse clicks the user made or the x,y coordinate of the mouse trackpoint (both relative to the source component and in absolute terms, relative to the screen) and about when the mouse action was performed.
  • Given an app that is very similar to L15App2, modify the code so that the app's appearance is changed (add or remove JPanels to the root container)