Java JTable Cell Editor isEditable(Component comp)

Here you can find the source of isEditable(Component comp)

Description

return false if Component is not editable, otherwise true

License

Open Source License

Declaration

public static boolean isEditable(Component comp) 

Method Source Code


//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import java.awt.Component;

import javax.swing.JComboBox;

import javax.swing.text.JTextComponent;

public class Main {
    /**//from w  ww .  j a  va2s  .c o  m
     * return false if Component is not editable, otherwise true
     */
    public static boolean isEditable(Component comp) {
        if (comp instanceof JTextComponent) {
            return ((JTextComponent) comp).isEditable();
        } else if (comp instanceof JComboBox) {
            return ((JComboBox) comp).isEditable();
        }

        else
            return true;
    }
}

Related

  1. createComboBox(Object items[], ActionListener listener, boolean editable)
  2. createEditableComboBox(String strActionCommand, ActionListener alListener, int iPreferredWidth)
  3. createTransclucentJTextAreaWithNoBorder(String text, boolean editable, boolean lineWrap, boolean wrapStyleWord)
  4. genHyperLinkEditor(final String uri, final Logger logger)
  5. installSimpleRenderesAndEditors(JTable table)
  6. processEditorRemovel(JTable aTable)
  7. setCellEditor(JTable table, int columnIdx, TableCellEditor editor)
  8. setCharacterAttributes(final AttributeSet attr, final boolean replace, final JEditorPane editorPane, final StyledDocument doc, final MutableAttributeSet inputAttrs)
  9. setClickCountToStartEditing(JTable table, int count)