diff options
Diffstat (limited to 'src/cuchaz/enigma/gui/Gui.java')
| -rw-r--r-- | src/cuchaz/enigma/gui/Gui.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java index 3dcb4e2..e357382 100644 --- a/src/cuchaz/enigma/gui/Gui.java +++ b/src/cuchaz/enigma/gui/Gui.java | |||
| @@ -28,6 +28,7 @@ import java.awt.event.WindowAdapter; | |||
| 28 | import java.awt.event.WindowEvent; | 28 | import java.awt.event.WindowEvent; |
| 29 | import java.io.File; | 29 | import java.io.File; |
| 30 | import java.io.IOException; | 30 | import java.io.IOException; |
| 31 | import java.lang.Thread.UncaughtExceptionHandler; | ||
| 31 | import java.util.Collection; | 32 | import java.util.Collection; |
| 32 | import java.util.Collections; | 33 | import java.util.Collections; |
| 33 | import java.util.Comparator; | 34 | import java.util.Comparator; |
| @@ -176,6 +177,22 @@ public class Gui | |||
| 176 | 177 | ||
| 177 | public Gui( ) | 178 | public Gui( ) |
| 178 | { | 179 | { |
| 180 | // init frame | ||
| 181 | m_frame = new JFrame( Constants.Name ); | ||
| 182 | final Container pane = m_frame.getContentPane(); | ||
| 183 | pane.setLayout( new BorderLayout() ); | ||
| 184 | |||
| 185 | // install a global exception handler to the event thread | ||
| 186 | CrashDialog.init( m_frame ); | ||
| 187 | Thread.setDefaultUncaughtExceptionHandler( new UncaughtExceptionHandler( ) | ||
| 188 | { | ||
| 189 | @Override | ||
| 190 | public void uncaughtException( Thread thread, Throwable ex ) | ||
| 191 | { | ||
| 192 | CrashDialog.show( ex ); | ||
| 193 | } | ||
| 194 | } ); | ||
| 195 | |||
| 179 | m_controller = new GuiController( this ); | 196 | m_controller = new GuiController( this ); |
| 180 | 197 | ||
| 181 | // init file choosers | 198 | // init file choosers |
| @@ -184,11 +201,6 @@ public class Gui | |||
| 184 | m_exportFileChooser = new JFileChooser(); | 201 | m_exportFileChooser = new JFileChooser(); |
| 185 | m_exportFileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ); | 202 | m_exportFileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ); |
| 186 | 203 | ||
| 187 | // init frame | ||
| 188 | m_frame = new JFrame( Constants.Name ); | ||
| 189 | final Container pane = m_frame.getContentPane(); | ||
| 190 | pane.setLayout( new BorderLayout() ); | ||
| 191 | |||
| 192 | // init obfuscated classes list | 204 | // init obfuscated classes list |
| 193 | m_obfClasses = new JList<String>(); | 205 | m_obfClasses = new JList<String>(); |
| 194 | m_obfClasses.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); | 206 | m_obfClasses.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); |