//SwingDemo example from "Java 2 Complete" publisher Sybex[1999]
import java.awt.*;
import javax.swing.*;
public class TablePanel extends JPanel
{
public TablePanel()
{
String[] columnTitles = {"col1", "col2","col3"};
String[][] rows =
{
{"AAA","BBb","Ccc"},
{"ddd","EeE","FfF"},
{"GGG","HHH","iii"},
{"jjj","KKk","LLL"},
{"Mmm","NNN","OoO"}
};
add(new JTable(rows,columnTitles));
}
} // end class |