For PART A: we want you to extend the PanelTest2.java program.
EXERCISE A-1: Draw borders around each of the 2 panels. You will need the getSize() method. EXERCISE A-2: The current buttons don't do anything. Make the "Quit" button cause the applet to terminate. Make the "Update" button read the text in the TextField, and update the label "Old Entry: (BLANK)" to "Old Entry: ..." where "..." is the text entered.
For PART B: we want you combine TranslateTest.java with the GUI interface of PanelTest2.java. The result is a zoom-pan GUI interface.
EXERCISE B-1: Merge the present program (TranslateTest.java) with the previous program (PanelTest2.java). You basically replace Label and TextField components in the original PanelTest2.java with a pannable image. Call the resulting program "Pan.java". In particular, the current image translation demo should be placed in the centerPanel of a workPanel. EXERCISE B-2: Extend Pan.java with the ability to zoom. Add two buttons named "+" and "-" into the controlPanel. Clicking these will double or half the image size. Call the resulting program PanZoom.java.
import java.awt.Toolkit; ... Image myI = getImage("file.name"); // method 1 URL myUrl = new URL("http://cs.nyu.edu/~yap/"); Image myI = getImage(myUrl); // method 2The getImage() method, however, is taken from the Toolkit. So be sure to do this import.
(1) The following java programs: PanelTest3.java (for part A-1), PanelTest4.java (for part A-2). Pan.java (for part B-1), PanZoom.java (for part B-2). (2) An associated html file for each of the four programs. The should be named "PanelTest3.html", "PanelTest4.html", "Pan.html" and "PanZoom.html". (2) a Makefile (by extending the Makefile we provided above) You need the following targets for your make file: one: to compile and test PanelTest3.java two: to compile and test PanelTest4.java three: to compile and test Pan.java four: to compile and test PanZoom.java