Example usage for javax.swing JComponent addVetoableChangeListener

List of usage examples for javax.swing JComponent addVetoableChangeListener

Introduction

In this page you can find the example usage for javax.swing JComponent addVetoableChangeListener.

Prototype

public synchronized void addVetoableChangeListener(VetoableChangeListener listener) 

Source Link

Document

Adds a VetoableChangeListener to the listener list.

Usage

From source file:Main.java

private static void addJContainerListeners(JComponent c, Object... objs) {
    if (c == null)
        return;/*from www  .ja  v a2  s .c  o  m*/
    addContainerListeners(c, objs);
    AncestorListener ancestorListener = search(objs, AncestorListener.class);
    VetoableChangeListener vetoableChangeListener = search(objs, VetoableChangeListener.class);
    if (ancestorListener != null)
        c.addAncestorListener(ancestorListener);
    if (vetoableChangeListener != null)
        c.addVetoableChangeListener(vetoableChangeListener);
}