addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); System.exit(0); } });
System.out.println("Starting PPP..."); PPP mainFrame = new PPP(); mainFrame.setSize(500, 300); mainFrame.setTitle("PPP"); mainFrame.setVisible(true);
// Instantiate the object p p = new PSubClass(); // Call its only method g.drawString("Calling p.getString() " + p.getString(),20,100); // g.drawString("Accessing the protected String directly " + p.s,20,200);