Returns a boolean indication whether the event represents a data Changed type in JTable. - Java Swing

Java examples for Swing:JTable Event

Description

Returns a boolean indication whether the event represents a data Changed type in JTable.

Demo Code


//package com.java2s;

import javax.swing.event.TableModelEvent;

public class Main {
    /**//from   w w w  .jav  a 2s .  c o  m
     * Returns a boolean indication whether the event represents a
     * dataChanged type.
     * 
     * @param e the event to examine.
     * @return true if the event is of type dataChanged, false else.
     */
    public static boolean isDataChanged(TableModelEvent e) {
        if (e == null)
            return false;
        return e.getType() == TableModelEvent.UPDATE
                && e.getFirstRow() == 0
                && e.getLastRow() == Integer.MAX_VALUE;
    }
}

Related Tutorials