This page provides links to some demo programs from class #3 (23 Sept).
Reflector.java exercises Java's reflection capabilities.
TryFrame.java demonstrates very basic JFrame operations.
Homework02_Plus.java adds an interface for printer-plotting to the Shape classes from homework #2. It allocates an array of these printer-plottable objects, fills it with Shapes, plots them out, and prints them as in the assignment. Here are the source files:
And here is a terminal session showing a run of the program:
D:\Teaching\CIS370\Web\demo\class03\hw02plus>javac *.java D:\Teaching\CIS370\Web\demo\class03\hw02plus>java Homework02_Plus +----------------------------------------------------------------------------+ |************************************************* | |********++++++++++++++++++++++******************* | |********++++++++++++++++++++++******************* | |********++++++++++++++++++++++******************* | |********++++++++++++++++++++++******************* | |********++++++++++++++++++++++******************* ++++ | |********++++++++++++++++++++++******************* ++++++ | |********++++++++++++++++++++++******************* ++++++++ | |********++++++++++++++++++++++******************* ++++++++ | |********+++++++++######+++++++****************** ++++++++ | |********++++++++########++++++**********%%%%%%%* ++++++++ | |********+++++++##########+++++*****************%%%@@@%%%%%%%++++++%%%%%@ | |********++++++############++++##****************@@%%%%@@@@@@@++++@@@@@@@ | |********+++++##############+++**#************** @@@@@@%%%%%%%@@@@@@@@@@@ | |********+++++##############+++***************** @@@@@@@@@@@@@%%%%@**********| |********+++++##############++****************** @@@@@@@@@@@@@@@@@%**********| |********+++++##############+++*****@@@******** @@@@@@@@@@@@@@@@@@**********| |*************##############***********@@@@**** @@@@@@@@@@@@@@@@@@**********| |*************##############***************@** @@@@@@@@@@@@@@@@@@**********| |**************############****************** @@@@@@@@@@@@@@@@@@**********| |***************##########******************* ------------@@@@@@**********| |****************########*O***************** ------------@@@@@@**********| |*****************######***O*************** * ------------@@@@@@**********| | **************************O************* ** ------------@@@@@@**********| | ************************************** **------------@@@@@@**********| | ************************************ **----------@@@@@@**********| | ********************************** --*---------@@@@@@**********| | ****************************** ---**-------@@@@@@**********| | **************************** -----**-----@@@@@@**********| | ************************ -------**---@@@@@@**********| | ****************** ---------*-- **********| | ********** ------------ **********| +----------------------------------------------------------------------------+ Line[x1=7,y1=9,x2=32,y2=19] Circle[x=22,y=18,r=13] Rectangle[x=48,y=11,w=23,h=18] Line[x1=8,y1=2,x2=9,y2=21] Rectangle[x=53,y=11,w=17,h=0] Circle[x=21,y=4,r=28] Ellipse[x=40,y=4,w=36,h=8] Circle[x=63,y=9,r=4] Rectangle[x=48,y=20,w=11,h=13] Line[x1=35,y1=16,x2=42,y2=18] Line[x1=16,y1=8,x2=32,y2=13] Line[x1=40,y1=10,x2=69,y2=16] Rectangle[x=66,y=14,w=20,h=18] Line[x1=10,y1=4,x2=27,y2=23] Rectangle[x=8,y=1,w=21,h=15] Ellipse[x=71,y=21,w=15,h=4] Ellipse[x=14,y=0,w=14,h=2] Circle[x=20,y=16,r=7] Ellipse[x=61,y=13,w=17,h=9] Line[x1=29,y1=15,x2=57,y2=30] D:\Teaching\CIS370\Web\demo\class03\hw02plus>