All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.meteoinfo.table.MyCellEditor Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meteoinfo.table;

import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author yaqiang
 */
public class MyCellEditor extends DefaultCellEditor {

    public MyCellEditor() {
        super(new JTextField());
    }

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
            int row, int column) {
        table.setColumnSelectionAllowed(false);
        table.setRowSelectionAllowed(true);
        return super.getTableCellEditorComponent(table, value, isSelected, row, column);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy