]> icculus.org git repositories - divverent/nexuiz.git/blob - misc/tools/NexuizDemoRecorder/src/main/java/com/nexuiz/demorecorder/ui/swinggui/utils/ShowErrorDialogExceptionHandler.java
move NDR main program into subfolder
[divverent/nexuiz.git] / misc / tools / NexuizDemoRecorder / src / main / java / com / nexuiz / demorecorder / ui / swinggui / utils / ShowErrorDialogExceptionHandler.java
1 package com.nexuiz.demorecorder.ui.swinggui.utils;\r
2 \r
3 import java.awt.Component;\r
4 import java.lang.Thread.UncaughtExceptionHandler;\r
5 \r
6 import org.jdesktop.swingx.JXErrorPane;\r
7 import org.jdesktop.swingx.error.ErrorInfo;\r
8 \r
9 public class ShowErrorDialogExceptionHandler implements UncaughtExceptionHandler {\r
10 \r
11         private static Component parentWindow = null;\r
12         \r
13         public void uncaughtException(Thread t, Throwable e) {\r
14                 ErrorInfo info = new ErrorInfo("Error occurred", e.getMessage(), null, null, e, null, null);\r
15                 JXErrorPane.showDialog(parentWindow, info);\r
16         }\r
17 \r
18         public static void setParentWindow(Component c) {\r
19                 parentWindow = c;\r
20         }\r
21 }\r