Example usage for java.awt.event ContainerEvent getSource

List of usage examples for java.awt.event ContainerEvent getSource

Introduction

In this page you can find the example usage for java.awt.event ContainerEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:ec.display.StatisticsChartPane.java

/**
 * This method initializes this/*from  www  . j av  a 2  s . c  o m*/
 * 
 * @return void
 */
private void initialize() {
    this.setSize(300, 200);
    this.addContainerListener(new java.awt.event.ContainerAdapter() {
        public void componentRemoved(java.awt.event.ContainerEvent e) {
            StatisticsChartPane pane = (StatisticsChartPane) e.getSource();
            if (pane.getTabCount() < 1) {
                pane.getParent().remove(pane);
            }
        }
    });
}