Java JTable Scroll createTableScrollPane(final JTable table)

Here you can find the source of createTableScrollPane(final JTable table)

Description

create Table Scroll Pane

License

Open Source License

Declaration

static public JScrollPane createTableScrollPane(final JTable table) 

Method Source Code

//package com.java2s;
/*//from   w  ww . jav a  2s .co m
 KDXplore provides KDDart Data Exploration and Management
 Copyright (C) 2015,2016,2017  Diversity Arrays Technology, Pty Ltd.

 KDXplore may be redistributed and may be modified under the terms
 of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option)
 any later version.

 KDXplore is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with KDXplore.  If not, see <http://www.gnu.org/licenses/>.
 */

import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.table.TableRowSorter;

public class Main {
    static public JScrollPane createTableScrollPane(final JTable table) {
        table.setRowSorter(new TableRowSorter<>(table.getModel()));
        return new JScrollPane(table);
    }
}

Related

  1. addHorizontalScrollBar(JTable table, JScrollPane pane)
  2. AutoScrollTable(final JTable table_packets)
  3. findScrollPane(JTable p_Table)
  4. getScrollPane(JTable myTable)
  5. makeTransparant(JTable table, JScrollPane scrollPane)
  6. scroll(JTable table, int rowIndex, int vColIndex)