本文整理汇总了Java中java.awt.event.ContainerAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ContainerAdapter类的具体用法?Java ContainerAdapter怎么用?Java ContainerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContainerAdapter类属于java.awt.event包,在下文中一共展示了ContainerAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import java.awt.event.ContainerAdapter; //导入依赖的package包/类
/**
* 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;
}
}
});
}
示例2: JXTaskPaneContainer
import java.awt.event.ContainerAdapter; //导入依赖的package包/类
/**
* 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);
}
示例3: JXTaskPaneContainer
import java.awt.event.ContainerAdapter; //导入依赖的package包/类
/**
* Creates a new empty taskpane.
*/
public JXTaskPaneContainer() {
super(null);
updateUI();
addContainerListener(new ContainerAdapter() {
public void componentRemoved(ContainerEvent e) {
repaint();
}
});
}
示例4: ensureUiStateIsCopiedForAddedComponents
import java.awt.event.ContainerAdapter; //导入依赖的package包/类
/**
* 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());
}
});
}