Example usage for javax.swing.table JTableHeader setToolTipText

List of usage examples for javax.swing.table JTableHeader setToolTipText

Introduction

In this page you can find the example usage for javax.swing.table JTableHeader setToolTipText.

Prototype

@BeanProperty(bound = false, preferred = true, description = "The text to display in a tool tip.")
public void setToolTipText(String text) 

Source Link

Document

Registers the text to display in a tool tip.

Usage

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;
    }
}