Terai Atsuhiro 2021-11-18 (木) 11:29:54

http://terai.xrea.jp/swing/cellhighlight/screenshot.png

public void mouseMoved(MouseEvent me) {
  Point pt = me.getPoint();
  int nrow = table.rowAtPoint(pt);
  int ncol = table.columnAtPoint(pt);
  AbstractTableModel model = (AbstractTableModel)table.getModel();
  if(nrow<0 || ncol<0) {
    row = -1;
    col = -1;
  }else{
    row = nrow;
    col = ncol;
  }
  table.repaint();
}