Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

public class Main {
    public static void main(String[] argv) throws Exception {
        DefaultTableModel model = new DefaultTableModel();
        JTable table = new JTable(model);

        // Add a column with values.
        model.addColumn("Col2", new Object[] { "v2" });

    }
}