Changeset 10035 in josm for trunk/src/org/openstreetmap/josm/gui/util
- Timestamp:
- 2016-03-23T22:36:15+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r10024 r10035 12 12 import java.awt.DisplayMode; 13 13 import java.awt.Font; 14 import java.awt.Frame; 14 15 import java.awt.GraphicsDevice; 15 16 import java.awt.GraphicsEnvironment; … … 509 510 }); 510 511 } 512 513 /** 514 * Returns the specified component's <code>Frame</code> without throwing exception in headless mode. 515 * 516 * @param parentComponent the <code>Component</code> to check for a <code>Frame</code> 517 * @return the <code>Frame</code> that contains the component, or <code>getRootFrame</code> 518 * if the component is <code>null</code>, or does not have a valid <code>Frame</code> parent 519 * @see JOptionPane#getFrameForComponent 520 * @see GraphicsEnvironment#isHeadless 521 * @since 10035 522 */ 523 public static Frame getFrameForComponent(Component parentComponent) { 524 if (parentComponent == null && GraphicsEnvironment.isHeadless()) { 525 return null; 526 } 527 return JOptionPane.getFrameForComponent(parentComponent); 528 } 511 529 }
Note:
See TracChangeset
for help on using the changeset viewer.