Skip to content

Commit

Permalink
Oups, wrong exception (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Oct 2, 2017
1 parent 3fb874c commit 1caacce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/imsweb/naaccrxml/gui/Standalone.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.IllegalComponentStateException;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Toolkit;
Expand Down Expand Up @@ -134,7 +135,7 @@ public Standalone() {
this.getContentPane().add(_centerPnl, BorderLayout.CENTER);

Thread.setDefaultUncaughtExceptionHandler((t, e) -> SwingUtilities.invokeLater(() -> {
boolean isLocationException = e instanceof IllegalStateException; // https://bugs.openjdk.java.net/browse/JDK-8179665
boolean isLocationException = e instanceof IllegalComponentStateException; // 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);
Expand Down Expand Up @@ -233,7 +234,7 @@ else if ("menu-about".equals(cmd)) {
SwingUtilities.invokeLater(() -> dlg.setVisible(true));
}
}

public static JLabel createItalicLabel(String text) {
JLabel lbl = new JLabel(text);
lbl.setFont(lbl.getFont().deriveFont(Font.ITALIC));
Expand Down

0 comments on commit 1caacce

Please sign in to comment.