Example usage for javax.swing JTable setCellEditor

List of usage examples for javax.swing JTable setCellEditor

Introduction

In this page you can find the example usage for javax.swing JTable setCellEditor.

Prototype

@BeanProperty(description = "The table's active cell editor.")
public void setCellEditor(TableCellEditor anEditor) 

Source Link

Document

Sets the active cell editor.

Usage

From source file:Main.java

public static void main(String[] args) {
    Object[][] rowData = {};/*ww w . ja v  a2  s.  c  om*/
    Object[] columnNames = { "Column 1", "Column 2", "Column 3" };

    DefaultTableModel listTableModel;
    listTableModel = new DefaultTableModel(rowData, columnNames);
    for (int i = 1; i < 25; i++) {
        String rowString = "Quiz #" + i;
        listTableModel.addRow(new Object[] { rowString, "ICON", "ICON" });
    }

    JTable listTable;
    listTable = new JTable(listTableModel);
    listTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    listTable.setCellEditor(null);
    listTable.setBounds(37, 143, 397, 183);

    JFrame frame = new JFrame();
    frame.add(new JScrollPane(listTable));
    frame.setVisible(true);
    frame.pack();
}