http://www.developer.com/tech/article.php/965221/User-Code-Place-a-Hyperlink-Hand-Cursor-on-a-JTable-Header.htm
Do you want to show a Hand Cursor when a Hyperlink label is placed on a table header? To place a simulated Hyperlink on the JTable Header,
you need to change the cursor to highlight the hyperlink effect of showing the
Hand cursor when the cursor is on top of the hyperlink. The following lines of code
guide the developer to simulate it. The steps you need to follow are: For further resources refer to the
author's site. If you have any questions mail to: range_gowda@hotmail.com>
User Code: Place a Hyperlink Hand Cursor on a JTable Header
January 30, 2002
processMouseMotionEvent.
*/
JTable customTable = new JTable(customTModel);
TableColumnModel tcm = customTable.getTableHeader().getColumnModel();
customTable.setTableHeader(new MyTableHeader(tcm));
class MyTableHeader extends JTableHeader
{
public MyTableHeader(TableColumnModel tcm) { super(tcm); }
public void processMouseMotionEvent(MouseEvent me)
{
int column = customTable.getTableHeader().columnAtPoint(me.getPoint());
if(column == 2) setCursor(new Cursor(Cursor.HAND_CURSOR));
else super.processMouseMotionEvent(me);
}
} // end of class MyTableHeader