Add Tooltips In Cells Of A JTable

Sad to say, there is no direct way to do so. The only way around this would be to override prepareRenderer() of a object, getting the JTableComponent object returned and set the tooltip value for that cell. Check the code below.

Related Posts Plugin for WordPress, Blogger...

4 comments

  1. Might want to change the line, to handle other types than just String:

    jc.setToolTipText((String) getValueAt(row, column));

    to

    jc.setToolTipText(getValueAt(row, column).toString());

Leave a Reply

Your email address will not be published. Required fields are marked *