List of usage examples for javax.swing JFrame toBack
public void toBack()
From source file:net.chaosserver.timelord.swingui.CommonTaskPanel.java
/** * Hides the application window out of site and mind on Win and Mac. *//*from w w w . j av a2s. c o m*/ protected void hideFrame() { JFrame frame = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, this); frame.toBack(); // Use reflection for compile-time avoidance. try { Class<?> nsApplicationClass = Class.forName("com.apple.cocoa.application.NSApplication"); Method sharedAppMethod = nsApplicationClass.getDeclaredMethod("sharedApplication", new Class<?>[] {}); Object nsApplicationObject = sharedAppMethod.invoke(null, new Object[] {}); /* Field userAttentionRequestCriticalField = nsApplicationClass.getDeclaredField( "UserAttentionRequestCritical"); */ Method hideMethod = nsApplicationClass.getDeclaredMethod("hide", new Class[] { Object.class }); hideMethod.invoke(nsApplicationObject, new Object[] { nsApplicationObject }); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Issue bouncing dock", e); } } }