Hi, so is there any chance of this change over to SecondaryLoop in the foreseeable future? I will have to gut an appalication I made with Foxtrot otherwise to get around the synchronization issues it had before using the lib. Thanks.
@Paolo well, perhaps you don't need to leave it. I may have some time to look at the project and implement the pump using SecondaryLoop. Cheers
confess I'm sorry to leave foxtrot but what to say ... it's time. Thanks for the support Simone. Ciao! 2018-08-13 15:52 GMT+02:00 Simone Bordet <simonebordet@users.sourceforge.net : Foxtrot could have an implementation based on SecondaryLoop, but this was not done. Rather than using SwingUtilities.invokelater(), you want to do this (did not try, just to give you an idea): Executor executor = ...; EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue(); SecondaryLoop loop = queue.createSecondaryLoop();...
Foxtrot could have an implementation based on SecondaryLoop, but this was not done. Rather than using SwingUtilities.invokelater(), you want to do this (did not try, just to give you an idea): Executor executor = ...; EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue(); SecondaryLoop loop = queue.createSecondaryLoop(); executor.execute(() -> { doWork(); loop.exit(); }); loop.enter(); Ciao!
The strength of foxtrot compared to swingutilities is undoubtedly the possibility of using its "Synchronous Solution". Using the API you mentioned, it is possible to replicate the feasibility using the secondaryloop ( https://docs.oracle.com/javase/7/docs/api/java/awt/SecondaryLoop.html) i see... Is it correct? Using a barbarian method and not wanting to go into detail it would be equivalent to invoke SwingUtilities.invokelater and then open a modal dialog. 2018-08-13 14:56 GMT+02:00 Simone Bordet...
Paolo, yes, Foxtrot does deep reflection on AWT classes. However, Foxtrot is now a bit out of date, it served a purpose back in the days of JDK 1.3. With JDK 1.7, a standard API for pumping AWT events has been added to the JDK, so applications should rely on that instead, see https://docs.oracle.com/javase/7/docs/api/java/awt/EventQueue.html#createSecondaryLoop(). Ciao!
Compilation warning - operations will be denied in a future release