You need to subclass JTable and override the method getToolTipText().
JTable table = new JTable(model)
{
public String getToolTipText(MouseEvent event)
{
int col = convertColumnIndexToModel(
columnAtPoint(event.getPoint()));
return getColumnName(col);
}
};
written by objects
\\ tags: JTable, tooltip
Swing uses the UIManager class to store defaults. Its put() method can be used to change these values.
// Change the default foreground color for tooltips
UIManager.put("ToolTip.foreground", Color.red);
// Change the default background color for tooltips
UIManager.put("ToolTip.background", Color.white);
written by objects
\\ tags: tooltip