本文整理匯總了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();
}