List of usage examples for javax.swing.table JTableHeader setToolTipText
@BeanProperty(bound = false, preferred = true, description = "The text to display in a tool tip.") public void setToolTipText(String text)
From source file:Main.java
public void mouseMoved(MouseEvent evt) { JTableHeader header = (JTableHeader) evt.getSource(); JTable table = header.getTable(); TableColumnModel colModel = table.getColumnModel(); int vColIndex = colModel.getColumnIndexAtX(evt.getX()); TableColumn col = null;/*w w w. ja v a 2s . co m*/ if (vColIndex >= 0) { col = colModel.getColumn(vColIndex); } if (col != curCol) { header.setToolTipText((String) tips.get(col)); curCol = col; } }