Here you can find the source of setDefaultTableEditorsClicks(JTable table, int clickCountToStart)
public static void setDefaultTableEditorsClicks(JTable table, int clickCountToStart)
//package com.java2s; //License from project: Open Source License import javax.swing.DefaultCellEditor; import javax.swing.JTable; import javax.swing.table.TableCellEditor; public class Main { /**/* w w w . j a va2 s .c om*/ * setDefaultTableEditorsClicks, This sets the number of clicks required to start the default * table editors in the supplied table. Typically you would set the table editors to start after * 1 click or 2 clicks, as desired. * * The default table editors of the table editors that are supplied by the JTable class, for * Objects, Numbers, and Booleans. Note, the editor which is used to edit Objects, is the same * editor used for editing Strings. */ public static void setDefaultTableEditorsClicks(JTable table, int clickCountToStart) { TableCellEditor editor; editor = table.getDefaultEditor(Object.class); if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).setClickCountToStart(clickCountToStart); } editor = table.getDefaultEditor(Number.class); if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).setClickCountToStart(clickCountToStart); } editor = table.getDefaultEditor(Boolean.class); if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).setClickCountToStart(clickCountToStart); } } }