FileDocCategorySizeDatePackage
Show.javaAPI DocExample3045Mon Apr 06 18:10:26 BST 1998c13.swing

Show

public class Show extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidinFrame(JPanel jp, int width, int height)

    String title = jp.getClass().toString();
    // Remove the word "class":
    if(title.indexOf("class") != -1)
      title = title.substring(6);
    JFrame frame = new JFrame(title);
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e){
        System.exit(0);
      }
    });
    frame.getContentPane().add(
      jp, BorderLayout.CENTER);
    frame.setSize(width, height);
    frame.setVisible(true);