Skip to content

Commit a43d832

Browse files
committed
Visual improvements
1 parent 7ee8f68 commit a43d832

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/nl/bascoder/keymanager/gui/MainWindow.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package nl.bascoder.keymanager.gui;
22

3+
import java.awt.Dimension;
4+
35
import javax.swing.JFrame;
46
import javax.swing.JOptionPane;
57
import javax.swing.JPanel;
@@ -26,16 +28,26 @@ private void initTable() {
2628
try {
2729
this.tblContent.setModel(new DatabaseTableModel());
2830
} 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);
3036
}
3137

3238
}
3339

3440
public static void main(String[] args) {
41+
initJFrame();
42+
}
43+
44+
private static void initJFrame() {
3545
JFrame frame = new JFrame("Key Manager");
3646
frame.setContentPane(new MainWindow().panel1);
3747
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
48+
frame.setMinimumSize(new Dimension(600, 200));
3849
frame.pack();
50+
frame.setLocationRelativeTo(null);
3951
frame.setVisible(true);
4052
}
4153
}

0 commit comments

Comments
 (0)