Ignore:
Timestamp:
2016-04-29T11:03:45+02:00 (4 years ago)
Author:
Don-vip
Message:

add more unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r10035 r10164  
    1616import java.awt.GraphicsEnvironment;
    1717import java.awt.GridBagLayout;
     18import java.awt.HeadlessException;
    1819import java.awt.Image;
    1920import java.awt.Stroke;
     
    522523     */
    523524    public static Frame getFrameForComponent(Component parentComponent) {
    524         if (parentComponent == null && GraphicsEnvironment.isHeadless()) {
     525        try {
     526            return JOptionPane.getFrameForComponent(parentComponent);
     527        } catch (HeadlessException e) {
     528            if (Main.isDebugEnabled()) {
     529                Main.debug(e.getMessage());
     530            }
    525531            return null;
    526532        }
    527         return JOptionPane.getFrameForComponent(parentComponent);
    528533    }
    529534}
Note: See TracChangeset for help on using the changeset viewer.