Example usage for java.awt Container isDisplayable

List of usage examples for java.awt Container isDisplayable

Introduction

In this page you can find the example usage for java.awt Container isDisplayable.

Prototype

public boolean isDisplayable() 

Source Link

Document

Determines whether this component is displayable.

Usage

From source file:pl.edu.icm.visnow.lib.utils.ImageUtilities.java

public static void sizeContainerToComponent(Container container, Component component) {
    if (container.isDisplayable() == false) {
        container.addNotify();//w  ww  .j  a v a2 s  .c  o  m
    }
    Insets insets = container.getInsets();
    Dimension size = component.getPreferredSize();
    int width = insets.left + insets.right + size.width;
    int height = insets.top + insets.bottom + size.height;
    container.setSize(width, height);
}