diff --git a/src/dev/kske/chess/ui/DialogUtil.java b/src/dev/kske/chess/ui/DialogUtil.java
index 0fa52e2..a25711d 100644
--- a/src/dev/kske/chess/ui/DialogUtil.java
+++ b/src/dev/kske/chess/ui/DialogUtil.java
@@ -10,11 +10,11 @@ import java.util.function.BiConsumer;
import java.util.function.Consumer;
import javax.swing.DefaultComboBoxModel;
-import javax.swing.JButton;
import javax.swing.JComboBox;
-import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
/**
* Project: Chess
@@ -33,55 +33,33 @@ public class DialogUtil {
action.accept(fileChooser.getSelectedFile());
}
- public static void showGameConfigurationDialog(BiConsumer action) {
- new JDialog() {
+ public static void showGameConfigurationDialog(Component parent, BiConsumer action) {
+ JPanel dialogPanel = new JPanel();
- private static final long serialVersionUID = -5768339760489440385L;
+ List options = new ArrayList<>(Arrays.asList("Natural Player", "AI Player"));
+ EngineUtil.getEngineInfos().forEach(info -> options.add(info.name));
- {
- setTitle("Game Configuration");
- setBounds(100, 100, 281, 142);
- setModal(true);
- setLocationRelativeTo(null);
- getContentPane().setLayout(null);
+ JLabel lblWhite = new JLabel("White:");
+ lblWhite.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblWhite.setBounds(10, 11, 49, 14);
+ dialogPanel.add(lblWhite);
- List options = new ArrayList<>(Arrays.asList("Natural Player", "AI Player"));
- EngineUtil.getEngineInfos().forEach(info -> options.add(info.name));
+ JComboBox