Browse Source

added name game and start button

master
Yazan Alaamer 2 years ago
parent
commit
491342cdd6
  1. 28
      src/main/java/game/StartDarkSoulsGame.java

28
src/main/java/game/StartDarkSoulsGame.java

@ -15,8 +15,11 @@ import javax.swing.JLabel;
public class StartDarkSoulsGame {
JPanel titleNamePanel;
JLabel titelNameLabel;
JPanel StartButtonPanel;
Font titelFont = new Font("Times new Roma", Font.PLAIN, 90);
JButton startButton; // commit (5) create start button
Container con;
public StartDarkSoulsGame() {
gui.Frame.setSize(800, 600);
gui.Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -24,12 +27,25 @@ public class StartDarkSoulsGame {
gui.Frame.setLayout(null);
gui.Frame.setVisible(true);
con = gui.Frame.getContentPane();
titleNamePanel = new JPanel(); // commit 2
titleNamePanel.setBounds(100,100,600, 150); // commit 2
titleNamePanel.setBackground(Color.black); // commit 2
titelNameLabel = new JLabel("Dark souls 4 "); // commit 2
titelNameLabel.setForeground(Color.white); // comiit 2
titelNameLabel.setFont(titelFont); // commit 2
titleNamePanel = new JPanel();
titleNamePanel.setBounds(100,100,600, 150);
titleNamePanel.setBackground(Color.black);
titelNameLabel = new JLabel("Dark souls 4 ");
titelNameLabel.setForeground(Color.white);
titelNameLabel.setFont(titelFont);
StartButtonPanel = new JPanel ();
StartButtonPanel.setBounds(300, 400, 200, 100);
StartButtonPanel.setBackground(Color.black);
startButton = new JButton("START");
startButton.setBackground(Color.black);
startButton.setForeground(Color.white);
titleNamePanel.add(titelNameLabel);
StartButtonPanel.add(startButton);
con.add(titleNamePanel);
con.add(StartButtonPanel); // commit 4 create start button panel
}
}
Loading…
Cancel
Save