/*Graphics2D02.java 12/12/99
Copyright 1999, R.G.Baldwin
Tested using JDK 1.2.2 under WinNT Workstation 4.0
**************************************/
import java.awt.geom.*;
import java.awt.*;
import java.awt.event.*;
class Graphics2D02{
publicstaticvoid main(String[] args){
GUI guiObj = new GUI();
}//end main
}//end controlling class Graphics2D02
class GUI extends Frame{
int res;//store screen resolution here
GUI(){//constructor
//Get screen resolution
res = Toolkit.getDefaultToolkit().
getScreenResolution();
System.out.println(res + " pixels per inch");
//Set Frame size to two-inches by two-inches
this.setSize(2*res,2*res);
this.setVisible(true);
this.setTitle("Copyright 1999, R.G.Baldwin");
//Window listener to terminate program.
this.addWindowListener(new WindowAdapter(){
publicvoid windowClosing(WindowEvent e){
System.exit(0);}});
}//end constructor
Figure 7