File tree 1 file changed +13
-1
lines changed
src/main/java/nl/bascoder/keymanager/gui
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
package nl .bascoder .keymanager .gui ;
2
2
3
+ import java .awt .Dimension ;
4
+
3
5
import javax .swing .JFrame ;
4
6
import javax .swing .JOptionPane ;
5
7
import javax .swing .JPanel ;
@@ -26,16 +28,26 @@ private void initTable() {
26
28
try {
27
29
this .tblContent .setModel (new DatabaseTableModel ());
28
30
} catch (Exception e ) {
29
- JOptionPane .showConfirmDialog (panel1 , "Failed to access database" );
31
+ JOptionPane .showConfirmDialog (panel1 ,
32
+ "Failed to access database" ,
33
+ "DB Error" ,
34
+ JOptionPane .OK_CANCEL_OPTION ,
35
+ JOptionPane .ERROR_MESSAGE );
30
36
}
31
37
32
38
}
33
39
34
40
public static void main (String [] args ) {
41
+ initJFrame ();
42
+ }
43
+
44
+ private static void initJFrame () {
35
45
JFrame frame = new JFrame ("Key Manager" );
36
46
frame .setContentPane (new MainWindow ().panel1 );
37
47
frame .setDefaultCloseOperation (WindowConstants .EXIT_ON_CLOSE );
48
+ frame .setMinimumSize (new Dimension (600 , 200 ));
38
49
frame .pack ();
50
+ frame .setLocationRelativeTo (null );
39
51
frame .setVisible (true );
40
52
}
41
53
}
You can’t perform that action at this time.
0 commit comments