Here you can find the source of convertSelectionToModel(JTable table)
Parameter | Description |
---|---|
table | the table |
public static int[] convertSelectionToModel(JTable table)
//package com.java2s; /*//ww w. j a v a 2s .com * Copyright 2008-2014, David Karnok * The file is part of the Open Imperium Galactica project. * * The code should be distributed under the LGPL license. * See http://www.gnu.org/licenses/lgpl.html for details. */ import javax.swing.JTable; public class Main { /** * Converts the selected view indexes to model indexes. * @param table the table * @return the selected model indices */ public static int[] convertSelectionToModel(JTable table) { int[] selected = table.getSelectedRows(); for (int i = 0; i < selected.length; i++) { selected[i] = table.convertRowIndexToModel(selected[i]); } return selected; } }