Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import javax.swing.*;

import javax.swing.table.DefaultTableModel;

public class Main {
    public static Object[] getData(int index, final JTable table) {
        DefaultTableModel model = (DefaultTableModel) table.getModel();
        Object[] rowData = new Object[model.getColumnCount()];
        for (int i = 0; i < rowData.length; i++) {
            rowData[i] = model.getValueAt(index, i);
        }
        return rowData;
    }
}