import java.awt.*; import java.awt.event.*; import javax.swing.*; /* Class that will create a Drawing (using the class Drawing), * add it to a pane, and show all in a frame. */ class DrawingInWindow{ public static void main(String[] args){ JFrame frame = new JFrame("My shapes on screen"); frame.addWindowListener(new DrawingWindowAdapter()); Container pane = frame.getContentPane(); pane.add(new Drawing()); frame.pack(); frame.show(); } } class DrawingWindowAdapter extends WindowAdapter{ public void windowClosing(WindowEvent e){System.exit(0);} }