package jminhep.gui;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.*;
import java.awt.GridLayout;
public class TableSummary extends JPanel {
public static final long serialVersionUID = 12342144;
public JTable table;
public MyTableModel model;
public TableSummary() {
super(new GridLayout(1,0));
model = new MyTableModel();
table = new JTable(model);
table.setRowHeight(22);
model.addColumn("Variable");
model.addColumn("Mean/Variance");
TableColumn column =null;
column = table.getColumnModel().getColumn(0);
column.setPreferredWidth(60);
column.setMinWidth(20);
column.setMaxWidth(180);
column = table.getColumnModel().getColumn(1);
column.setPreferredWidth(140);
column.setMinWidth(50);
column.setMaxWidth(200);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this panel.
add(scrollPane);
}
}
Ads help maintain this website.