Skip to content

Commit

Permalink
Addressed a bug crashing the GUI when minimizing the app (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Oct 2, 2017
1 parent 1637006 commit 3fb874c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## NAACCR XML Version History

**Version 4.1**

- Addressed a bug crashing the Standalone GUI when minimizing the application.

**Version 4.0**

- Relaxed the validation of the NAACCR numbers in user-defined dictionaries (specification 1.3).
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/imsweb/naaccrxml/gui/Standalone.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ public Standalone() {
this.getContentPane().add(_centerPnl, BorderLayout.CENTER);

Thread.setDefaultUncaughtExceptionHandler((t, e) -> SwingUtilities.invokeLater(() -> {
String msg = "An unexpected error happened, it is recommended to close the application.\n\n Error: " + (e.getMessage() == null ? "null access" : e.getMessage());
JOptionPane.showMessageDialog(Standalone.this, msg, "Error", JOptionPane.ERROR_MESSAGE);
boolean isLocationException = e instanceof IllegalStateException; // https://bugs.openjdk.java.net/browse/JDK-8179665
if (!isLocationException) {
String msg = "An unexpected error happened, it is recommended to close the application.\n\n Error: " + (e.getMessage() == null ? "null access" : e.getMessage());
JOptionPane.showMessageDialog(Standalone.this, msg, "Error", JOptionPane.ERROR_MESSAGE);
}
}));

SwingUtilities.invokeLater(() -> _buttons.get(0).doClick());
Expand Down

0 comments on commit 3fb874c

Please sign in to comment.