I need to display tooltips for my Jtable header. hence I subclassed
JTableHeader as follows -
protected class TooltipHeader extends JTableHeader{
public String getToolTipText(MouseEvent e){
int column = columnAtPoint(e.getPoint());
if (column == -1){
return getToolTipText();
}
int dataColumn = getColumnModel().getColumn(column).getModelIndex();
TableColumn tc = getColumnModel().getColumn(dataColumn);
return tc.getHeaderValue().toString();
}
}
And set it as a Header for th etable, however with this header my Jtable
header is not visible at all. What could be wrong?
TIA,
- Manish
> I need to display tooltips for my Jtable header.
not sure what the problem is, but have
you checked out the Tame examples
ToolTipTableHeader?
<http://www.physci.org/codes/tame/>

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Manish Hatwalne - 29 Apr 2004 08:46 GMT
Got It.
Added constructor to this class which took a ColumnModel and passed it to
super. Worked properly. :)
- Manish
> > I need to display tooltips for my Jtable header.
>
[quoted text clipped - 8 lines]
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.1point1C.org/ Science & Technology