Java Swing Tutorial - Java DefaultCellEditor .isCellEditable (EventObject anEvent)








Syntax

DefaultCellEditor.isCellEditable(EventObject anEvent) has the following syntax.

public boolean isCellEditable(EventObject anEvent)

Example

In the following code shows how to use DefaultCellEditor.isCellEditable(EventObject anEvent) method.

//from   ww w .ja va2 s. c om
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

public class Main {
  public static void main(String[] argv) throws Exception {
    TableModel model = new DefaultTableModel() {
      public boolean isCellEditable(int rowIndex, int mColIndex) {
        return false;
      }
    };

    JTable table2 = new JTable(model);
  }
}