Drawing Example Using the 2Dapi
public class Example2D extends Frame {
public static void main(String[] argv) {
Example2D myExample = new Example2D();
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
dispose();System.exit(0);