List of usage examples for java.awt Window getFocusableWindowState
public boolean getFocusableWindowState()
From source file:org.eclipse.wb.internal.swing.utils.SwingImageUtils.java
/** * Prepares {@link Component} for printing. * //from ww w.j a v a2 s .c om * mitin_aa: Linux: for Metacity window manager (as recommended to use with the Designer) to * prevent preview window flickering a better place for preview window is right-bottom screen * direction. * * TODO: add a preference (Linux only) allowing the user to explicitly set preview window location */ public static void prepareForPrinting(Component component) throws Exception { component.setLocation(10000, 10000); // don't grab focus during printing if (component instanceof Window) { Window window = (Window) component; m_fosucableStates.put(window, window.getFocusableWindowState()); window.setFocusableWindowState(false); } // make visible setVisible(component, true); { // workaround to prevent window from flashing if the Window Manager // doesn't allow the window to appear off-screen. if (component instanceof Window) { Window window = (Window) component; window.toBack(); // do the location change once again, because sometimes setLocation() // for invisible windows could be ignored. component.setLocation(10000, 10000); } } }