Hey guys, working on an event calendar. I'm having some trouble getting my column heads to display.. here is the code
private JTable calendarTable;
private DefaultTableModel calendarTableModel;
final private String [] days = {"Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday",
"Saturday"};
//////////////////////////////////////////////////////////////////////
/* Setup the actual calendar table */
calendarTableModel = new DefaultTableModel() {
public boolean isCellEditable(int row, int col){
return false;
}
};
// setup columns
for(int i = 0; i < 7; i++)
calendarTableModel.addColumn(days[i]);
calendarTable = new JTable(calendarTableModel);
calendarTable.getTableHeader().setResizingAllowed(false);
calendarTable.getTableHeader().setReorderingAllowed(false);
calendarTable.setColumnSelectionAllowed(true);
calendarTable.setRowSelectionAllowed(true);
calendarTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
calendarTable.setRowHeight(105);
calendarTableModel.setColumnCount(7);
calendarTableModel.setRowCount(6);
Also, Im sort of new with tables.. how can I make the rowHeight split between the max size of the table?