import type.lang.*;
import java.awt.*;

public class DemoToolkit
{
   public static void main(String[] args)
   {
		// Toolkit is an 'abstract' class, so it cannot 
		// be instantiated.  That's too bad, because there
		// are some useful methods available in 
		// Tooklit (see API).  One of the methods, 
		// 'getDefaultTooklit', is static and it returns
		// an instance of Toolkit.  This is possible because
		// an implementation is provided with the Java SDK,  
		// and it 'knows about' the target system.
		// Let's get it an instance of Toolkit.

		Toolkit t = Toolkit.getDefaultToolkit();

		// Now that we have an instance of Toolkit, we can
		// do a variety of system-dependent things.  Let's
		// see what the size of the screen is on the
		// target system.

		Dimension d = t.getScreenSize();
		int w = d.width;
		int h = d.height;
		IO.println("Screen size: width=" + w + " height=" + h);

		// The following should emit a beep on the target system.
		// It doesn't seem to work on mine, however.  It's an IBM 
		// Thinkpad R31 running Windows XP.  Hmmm.  Does it work
		// on your system?

		t.beep();

		// Just out of curiosity, let's see if getDefaultToolkit
		// returns a reference to a Toolkit object, or if it
		// returns a reference to an object of some other class
		// that happens to extend Toolkit and implement the
		// abstract methods in Toolkit.

		IO.println("Class of t: " + t.getClass());
   }
}

