本文整理汇总了Java中javax.swing.table.JTableHeader.repaint方法的典型用法代码示例。如果您正苦于以下问题:Java JTableHeader.repaint方法的具体用法?Java JTableHeader.repaint怎么用?Java JTableHeader.repaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.table.JTableHeader
的用法示例。
在下文中一共展示了JTableHeader.repaint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: repaintTimeline
import javax.swing.table.JTableHeader; //导入方法依赖的package包/类
private void repaintTimeline() {
JTableHeader header = threadsTable.getTableHeader();
TableColumn draggedColumn = header.getDraggedColumn();
if (draggedColumn != null && draggedColumn.getModelIndex() == 2) {
header.repaint();
} else {
int _column = threadsTable.convertColumnIndexToView(2);
header.repaint(header.getHeaderRect(_column));
}
}
示例2: populateTableHeaders
import javax.swing.table.JTableHeader; //导入方法依赖的package包/类
public void populateTableHeaders() {
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
final Calendar c = Calendar.getInstance();
c.setTime(masterDate.getTime());
JTableHeader tableHeader = table.getTableHeader();
TableColumnModel tableColumnModel = tableHeader.getColumnModel();
TableColumn tableColumn;
tableColumn = tableColumnModel.getColumn(0);
tableColumn.setHeaderValue("ROOM");
tableColumn = tableColumnModel.getColumn(1);
tableColumn.setHeaderValue("TYPE");
tableColumn = tableColumnModel.getColumn(2);
tableColumn.setHeaderValue("STATUS");
//start the date from minus 1 to get today date.
c.add(Calendar.DATE, -1);
//start the loop from 3 because first 3 columns already
//populated up and the loop on 10 to get one week
for (int i = 3; i < 10; i++) {
c.add(Calendar.DATE, 1);
today = simpleDateFormat.format(c.getTime());
tableColumn = tableColumnModel.getColumn(i);
tableColumn.setHeaderValue(today);
//store dates in special array to use it in bottom
weekDates[i] = today;
}
tableHeader.revalidate();
tableHeader.repaint();
}