diff --git a/src/MainMenu.java b/src/MainMenu.java index 4886491..184a326 100644 --- a/src/MainMenu.java +++ b/src/MainMenu.java @@ -1,3 +1,4 @@ +import javax.management.StandardEmitterMBean; import javax.swing.*; import java.awt.*; @@ -12,23 +13,54 @@ public class MainMenu extends Screen */ MainMenu() { super(); - + JPanel gameSelectionPanel = new JPanel(); JPanel gameInfoPanel = new JPanel(); gameSelectionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Gui.getMessages().getString("gameSelection"))); gameInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(Gui.getMessages().getString("gameInfo"))); - JButton standardGameButton = new JButton(Gui.getMessages().getString("standard")); - JButton duelGameButton = new JButton(Gui.getMessages().getString("duel")); - JButton gameInfoButton = new JButton(Gui.getMessages().getString("help")); + //Construct new Components + JLabel title = new JLabel("Memory Game"); + JButton standardGameButton = new JButton("Standard"); + JButton duelGameButton = new JButton("Duel"); + JButton gameInfoButton = new JButton("Help"); + //End + + //Set properties of new Components + standardGameButton.setBackground(new Color(59, 89, 182)); + standardGameButton.setForeground(Color.WHITE); + standardGameButton.setFocusPainted(false); + standardGameButton.setFont(new Font("Tahoma", Font.BOLD, 6)); + + duelGameButton.setBackground(new Color(59, 89, 182)); + duelGameButton.setForeground(Color.WHITE); + duelGameButton.setFocusPainted(false); + duelGameButton.setFont(new Font("Tahoma", Font.BOLD, 6)); + + gameInfoButton.setBackground(new Color(59, 89, 182)); + gameInfoButton.setForeground(Color.WHITE); + gameInfoButton.setFocusPainted(false); + gameInfoButton.setFont(new Font("Tahoma", Font.BOLD, 12)); + //End + + + title.setText("Memory Game"); + + //Add Bounds + title.setBounds (575, 45, 500, 70); + standardGameButton.setBounds (385, 200, 255, 60); + standardGameButton.setPreferredSize(new Dimension(255, 60)); + duelGameButton.setBounds (770, 200, 255, 60); + duelGameButton.setPreferredSize(new Dimension(255, 60)); + gameInfoButton.setBounds(560, 900, 255, 60); standardGameButton.setFont(getMainFont()); duelGameButton.setFont(getMainFont()); gameInfoButton.setFont(getMainFont()); - gameInfoButton.setForeground(Color.BLUE); - gameInfoButton.setPreferredSize(new Dimension(650, 400)); + gameInfoButton.setForeground(Color.WHITE); + gameInfoButton.setPreferredSize(new Dimension(255, 60)); gameInfoButton.addActionListener(e -> infoMessage()); @@ -44,10 +76,12 @@ public class MainMenu extends Screen GridLayout grid = new GridLayout(2, 0, 10, 20); - gameSelectionPanel.setLayout(grid); + //Added Absolute Positioning + gameSelectionPanel.setLayout(null); gameSelectionPanel.add(standardGameButton); gameSelectionPanel.add(duelGameButton); + gameSelectionPanel.add(title); gameInfoPanel.add(gameInfoButton); getMainFrame().setLayout(grid);