// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;

public class Table1 extends JFrame {
    public Table1() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        getContentPane().setLayout(new BorderLayout());
        setTitle("Very simple table");
        String[] colnam = new String[] { "F1", "F2" };
        Object[][] data = new Object[][] { new Object[] { 1, "A" },new Object[] { 2, "BB" },new Object[] { 3, "CCC" } }; 
        JTable tbl = new JTable(data, colnam);
        getContentPane().add(new JScrollPane(tbl), BorderLayout.CENTER);
        pack();
    }
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JFrame f = new Table1();
                f.setVisible(true);
            }
        });
    }
}
