System.out.println("system tray not supported"); addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent e) { if(e.getNewState()==ICONIFIED){
public static Closeable onWindowStateChanged( final Window component, final Reciver<WindowEvent> consumer ){ if( component==null )throw new IllegalArgumentException( "component==null" ); if( consumer==null )throw new IllegalArgumentException( "consumer==null" ); final WindowStateListener ml = new WindowStateListener() { @Override public void windowStateChanged(WindowEvent e) { consumer.recive(e); } }; component.addWindowStateListener(ml); Closeable cl = new Closeable() { Window cmpt = component; WindowStateListener l = ml; @Override public void close() throws IOException { if(cmpt!=null && l!=null ){ cmpt.removeWindowStateListener(l); cmpt = null; l = null; } }}; return cl; } //</editor-fold>
public static void createWindowStateListeners(ActionContext actionContext){ Thing self = (Thing) actionContext.get("self"); Window parent = (Window) actionContext.get("parent"); for(Thing child : self.getChilds()){ WindowStateListener l = (WindowStateListener) child.doAction("create", actionContext); if(l != null){ parent.addWindowStateListener(l); } } }
@Override public void registerEvents() { super.registerEvents(); if (mHandlee != null) { if (mHandlee instanceof Window) { ((Window) mHandlee).addWindowListener(this); ((Window) mHandlee).addWindowStateListener(this); } if (mHandlee instanceof JInternalFrame) { ((JInternalFrame) mHandlee).addInternalFrameListener(this); ((JInternalFrame) mHandlee).addPropertyChangeListener(this); } } }
frame.getContentPane().add(outerPanel, BorderLayout.CENTER); frame.addWindowStateListener(new WindowStateListener() { @Override public void windowStateChanged(WindowEvent event) {
frame.addWindowStateListener(new WindowAdapter() { @Override public void windowStateChanged(WindowEvent we) {
ownerWindow = SwingUtilities.getWindowAncestor(owner); if( null != ownerWindow ) { ownerWindow.addWindowStateListener(windowListener);
this.addWindowListener(this); this.addWindowFocusListener(this); this.addWindowStateListener(this); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null);
frame.addWindowStateListener(new WindowStateListener() {
System.out.println("system tray not supported"); addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent e) { if (e.getNewState() == ICONIFIED) {
frame.addWindowStateListener(h); frame.addWindowListener(h);
System.out.println("system tray not supported"); addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent e) { if(e.getNewState()==ICONIFIED){
final IconizeWindowState state= new IconizeWindowState(); frame.addWindowStateListener(new WindowAdapter()
private void initializeWinowEventListeners(Window window) { window.addWindowStateListener(e -> { if (e.getNewState() == Frame.ICONIFIED) { Game.renderLoop().setMaxFps(ICONIFIED_MAX_FPS);