Java Code Examples for java.awt.event.ContainerAdapter

The following are top voted examples for showing how to use java.awt.event.ContainerAdapter. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AgentWorkbench   File: BasicGraphGui.java   View source code 6 votes vote down vote up
/**
 * This method initializes this
 */
private void initialize() {

	// --- Set appearance -----------------------------
	this.setVisible(true);
	this.setSize(300, 300);
	this.setLayout(new BorderLayout());
	this.setDoubleBuffered(true);
	
	// --- Add components -----------------------------
	this.add(this.getJPanelToolBars(), BorderLayout.WEST);
	this.add(this.getGraphZoomScrollPane(), BorderLayout.CENTER);

	this.addContainerListener(new ContainerAdapter() {
		boolean doneAdded = false;
		@Override
		public void componentAdded(ContainerEvent ce) {
			if (doneAdded==false) {
				validate();
				zoomSetInitialScalingAndMovement(getVisualizationViewer());
				doneAdded=true;
			}
		}
	});
}
 
Example 2
Project: swingx   File: JXTaskPaneContainer.java   View source code 5 votes vote down vote up
/**
 * Creates a new empty task pane.
 */
public JXTaskPaneContainer() {
    super(null);
    updateUI();

    addContainerListener(new ContainerAdapter() {
        @Override
        public void componentRemoved(ContainerEvent e) {
            repaint();
        }
    });
    setScrollableHeightHint(ScrollableSizeHint.PREFERRED_STRETCH);
}
 
Example 3
Project: aibench-project   File: JXTaskPaneContainer.java   View source code 5 votes vote down vote up
/**
 * Creates a new empty taskpane.
 */
public JXTaskPaneContainer() {
    super(null);
  updateUI();
  
  addContainerListener(new ContainerAdapter() {
      public void componentRemoved(ContainerEvent e) {
          repaint();
      }
  });
}
 
Example 4
Project: viskit   File: JImageListView.java   View source code 5 votes vote down vote up
/**
 * Ensures {@link #copyUiStateToSubComponent(java.awt.Component) } will
 * be called for any child component added to this component in the
 * future. Called once by the default constructor of JImageListView.
 * Subclasses may (rarely) override, e.g. with an empty implementation
 * if they want to inhibit this behaviour for some (strange) reason.
 */
protected void ensureUiStateIsCopiedForAddedComponents() {
    this.addContainerListener(new ContainerAdapter() {
        @Override
        public void componentAdded(ContainerEvent e) {
            JImageListView.this.copyUiStateToSubComponent(e.getChild());
        }
    });
}