List of usage examples for java.awt Window getComponentListeners
public synchronized ComponentListener[] getComponentListeners()
From source file:Utils.java
/** * Installs/resets a ComponentListener to resize the * given window to minWidth/Height if needed. * * @param window//ww w . j a va 2s . c om * @param minWidth * @param minHeight */ public static void setMinimumSizeManager(Window window, int minWidth, int minHeight) { ComponentListener[] listeners = window.getComponentListeners(); ComponentListener listener = null; for (ComponentListener l : listeners) { if (l instanceof MinSizeComponentListener) { listener = l; break; } } if (listener == null) { window.addComponentListener(new MinSizeComponentListener(window, minWidth, minHeight)); } else { ((MinSizeComponentListener) listener).resetSizes(minWidth, minHeight); } }