本文整理匯總了Java中javax.swing.table.JTableHeader.putClientProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java JTableHeader.putClientProperty方法的具體用法?Java JTableHeader.putClientProperty怎麽用?Java JTableHeader.putClientProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.table.JTableHeader
的用法示例。
在下文中一共展示了JTableHeader.putClientProperty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDefaultTableHeader
import javax.swing.table.JTableHeader; //導入方法依賴的package包/類
/** This method ensures that the correct tool tip for the current column is delivered. */
@Override
protected JTableHeader createDefaultTableHeader() {
JTableHeader header = new JTableHeader(columnModel) {
private static final long serialVersionUID = 1L;
@Override
public String getToolTipText(MouseEvent e) {
java.awt.Point p = e.getPoint();
int index = columnModel.getColumnIndexAtX(p.x);
int realColumnIndex = convertColumnIndexToModel(index);
if (realColumnIndex >= 0 && realColumnIndex < getModel().getColumnCount()) {
return "The column " + getModel().getColumnName(realColumnIndex);
} else {
return "";
}
}
};
header.putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
return header;
}
示例2: createDefaultTableHeader
import javax.swing.table.JTableHeader; //導入方法依賴的package包/類
/** This method ensures that the correct tool tip for the current column is delivered. */
@Override
protected JTableHeader createDefaultTableHeader() {
JTableHeader header = new JTableHeader(columnModel) {
private static final long serialVersionUID = 1L;
@Override
public String getToolTipText(MouseEvent e) {
java.awt.Point p = e.getPoint();
int index = columnModel.getColumnIndexAtX(p.x);
int realColumnIndex = convertColumnIndexToModel(index);
return DataViewerTable.this.getHeaderToolTipText(realColumnIndex);
}
};
header.putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
return header;
}