Here you can find the source of getSelectedCase(JTable table)
public static Integer getSelectedCase(JTable table)
//package com.java2s; //License from project: Open Source License import javax.swing.JTable; public class Main { public static Integer getSelectedCase(JTable table) { int selectedRow = table.getSelectedRow(); if (selectedRow >= 0) { return (int) table.getModel().getValueAt(selectedRow, 0); } else {/*from www . j a va2 s. c o m*/ return null; } } }