Example usage for javax.swing.event TableModelEvent DELETE

List of usage examples for javax.swing.event TableModelEvent DELETE

Introduction

In this page you can find the example usage for javax.swing.event TableModelEvent DELETE.

Prototype

int DELETE

To view the source code for javax.swing.event TableModelEvent DELETE.

Click Source Link

Document

Identifies the removal of rows or columns.

Usage

From source file:phex.gui.tabs.upload.UploadFilesTableModel.java

@EventTopicSubscriber(topic = PhexEventTopics.Upload_State)
public void onUploadStateEvent(String topic, final ContainerEvent event) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            int position = event.getPosition();
            if (event.getType() == ContainerEvent.Type.ADDED) {
                fireTableChanged(new TableModelEvent(UploadFilesTableModel.this, position, position,
                        TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));
            } else if (event.getType() == ContainerEvent.Type.REMOVED) {
                fireTableChanged(new TableModelEvent(UploadFilesTableModel.this, position, position,
                        TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE));
            }/*w ww.j a  v  a 2s  . c  o m*/
        }
    });
}