Java JTable Select getSelectedCase(JTable table)

Here you can find the source of getSelectedCase(JTable table)

Description

get Selected Case

License

Open Source License

Declaration

public static Integer getSelectedCase(JTable table) 

Method Source Code

//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;
        }
    }
}

Related

  1. copyTableSelectionsToJList(JList list, JTable listTbl)
  2. createJCheckBoxForTable(boolean selected)
  3. disableSelection(JTable table)
  4. getSelectedObject(JTable table)
  5. getSelectionBackground(JTable t)
  6. invertSelect(JTable table)
  7. invertSelection(JTable table)