FileDocCategorySizeDatePackage
TableDemo.javaAPI DocExample4494Tue Dec 12 18:59:28 GMT 2000None

TableDemo

public class TableDemo extends JFrame

Fields Summary
private boolean
DEBUG
Constructors Summary
public TableDemo()


      
        super("TableDemo");

        MyTableModel myModel = new MyTableModel();
        JTable table = new JTable(myModel);
        table.setPreferredScrollableViewportSize(new Dimension(500, 70));

        //Create the scroll pane and add the table to it. 
        JScrollPane scrollPane = new JScrollPane(table);

        //Add the scroll pane to this window.
        getContentPane().add(scrollPane, BorderLayout.CENTER);

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    
Methods Summary
public static voidmain(java.lang.String[] args)

        TableDemo frame = new TableDemo();
        frame.pack();
        frame.setVisible(true);