Terai Atsuhiro 2023-07-11 (火) 09:56:08

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

table.addMouseListener(new MouseInputAdapter() {
  public void mouseClicked(MouseEvent me) {
    int col = table.columnAtPoint(me.getPoint());
    if(col==0 && me.getClickCount()==2) {
      showInfo(me);
      table.repaint();
    }else{
      super.mouseClicked(me);
    }
  }
});
private void showInfo(final MouseEvent me) {
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      int row = sorter.modelIndex(table.rowAtPoint(me.getPoint()));
      String str = model.getValueAt(row, 1)+"("+model.getValueAt(row, 2)+")";

                                    JOptionPane.INFORMATION_MESSAGE);
    }
  });
}