List of usage examples for javax.swing JTable getBorder
public Border getBorder()
null
if no border is currently set. From source file:de.mprengemann.intellij.plugin.androidicons.forms.AndroidBatchScaleImporter.java
private void initExportNameValidator() { table.getColumnModel().getColumn(5).setCellEditor(new DefaultCellEditor(new JTextField()) { @Override//from w w w .jav a 2 s.c om public boolean stopCellEditing() { boolean result = super.stopCellEditing(); if (!result) { return false; } String value = (String) getCellEditorValue(); value = value.trim(); if ((StringUtils.isNotEmpty(value) && value.matches("[a-z0-9_.]*"))) { return super.stopCellEditing(); } ((JComponent) this.getComponent()).setBorder(new LineBorder(JBColor.RED)); return false; } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { ((JComponent) this.getComponent()).setBorder(table.getBorder()); return super.getTableCellEditorComponent(table, value, isSelected, row, column); } }); }