List of usage examples for java.awt Container isDisplayable
public boolean isDisplayable()
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); }