Thanks. Committed.
On 6/21/2013 6:33 AM, Michael Kussmaul wrote:
> Hi
>
> Apple recently released a new java-update (1.6.0_51) which broke many
> swing-GUI apps - JTSTestBuilder seems also broken :-) The GUI just does not
> seem to accept any mouse-interaction anymore.
>
> Now, it seems this java update enforces a security convention which was
> tolerated in the past (so it might fail on other Oracle java-implementations
> as well, perhaps in the future?).
>
> The problem is: Setting the look-and-feel needs to be done on the
> Swing-Thread. So the fix is relatively easy, you should just wrap it to be
> called on the correct thread - you need to edit one file (see below).
>
> I just posted this if someone else experienced the same problem... feel free
> to include it in jts-repository if you like.
>
> kind regards
> Michael
>
>
> jtsapp/src/main/java/com/vividsolutions/jtstest/testbuilder/JTSTestBuilder.java:
> ===================================================================
> --- JTSTestBuilder.java (revision 831)
> +++ JTSTestBuilder.java (working copy)
> @@ -149,11 +149,20 @@
>
> // set the look and feel, using user-defined LAF if present
> // eg. Metal -
> -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
> - String laf = System.getProperty("swing.defaultlaf");
> - if (laf == null) {
> - laf = UIManager.getSystemLookAndFeelClassName();
> - }
> - UIManager.setLookAndFeel(laf);
> + javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
> + public void run() {
> + try {
> + String laf = System.getProperty("swing.defaultlaf");
> + if (laf == null) {
> + laf =
> UIManager.getSystemLookAndFeelClassName();
> + }
> + javax.swing.UIManager.setLookAndFeel(laf);
> + } catch (Exception e) {
> + e.printStackTrace();
> + }
> + }
> + });
> +
>
> app = new JTSTestBuilder();
> app.initFrame();
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Jts-topo-suite-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2013.0.2904 / Virus Database: 3184/6359 - Release Date: 05/26/13
> Internal Virus Database is out of date.
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user