Changeset 8079 in josm


Ignore:
Timestamp:
2015-02-17T22:09:34+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #11123 - IllegalArgumentException when resizing window with active notes popup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r7882 r8079  
    150150                Dimension d = toolTip.getUI().getPreferredSize(toolTip);
    151151                d.width = Math.min(d.width, (mv.getWidth() * 1 / 2));
    152                 toolTip.setSize(d);
    153                 toolTip.paint(g);
     152                if (d.width > 0 && d.height > 0) {
     153                    toolTip.setSize(d);
     154                    try {
     155                        toolTip.paint(g);
     156                    } catch (IllegalArgumentException e) {
     157                        // See #11123 - https://bugs.openjdk.java.net/browse/JDK-6719550
     158                        // Ignore the exception, as Netbeans does: http://hg.netbeans.org/main-silver/rev/c96f4d5fbd20
     159                        Main.error(e, false);
     160                    }
     161                }
    154162            }
    155163            g.translate(-tx, -ty);
Note: See TracChangeset for help on using the changeset viewer.