/ Published in: Groovy
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Laurence Toenjes 2011-03-13 This is a "crude" global JButton fix click solution, because: Sometimes when using internal frames, it takes two clicks on a button to get the actionPerformed code to fire. How to use (one call in app startup code): FixButtonClick.init() */ /* development settings to relax java security file: ${user.home}/.java.policy grant codeBase "file:///-" { permission java.security.AllPermission "java.security.AllPermission.*"; }; grant codeBase "http://localhost/-" { permission java.security.AllPermission "java.security.AllPermission.*"; }; */ class FixButtonClick { aButton.getClientProperty( sKey ) } aButton.addMouseListener( e.source.doClick() } } // end mousePressed } // end MouseAdapter ); } // Global Event Listener FixButtonClick.fixButtonClick( event.source ); } }; r.run(); } else { SU.invokeAndWait( r ); } } // isMouseEntered } // isJButton && isMouseEvent } } // mask = Long.MAX_VALUE; // all events } // end init } // end class