Kronjuwild #6

Merged
ole merged 12 commits from Kronjuwild into main 2024-11-14 16:23:21 +00:00
2 changed files with 25 additions and 9 deletions
Showing only changes of commit 372a29698a - Show all commits

View File

@ -5,7 +5,7 @@ public class HalloSchiffeVersenken {
System.out.println("HelloSchiffeVersenekn");
/**
System.out.println("sound");
SoundHandler.playSound("hit");
Thread.sleep(3000);
@ -14,6 +14,7 @@ public class HalloSchiffeVersenken {
SoundHandler.setSoundOn(false);
System.out.println("sound off");
SoundHandler.playSound("hit");
*/
}

View File

@ -1,3 +1,4 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
@ -6,23 +7,37 @@ import javax.swing.*;
public class MainMenu implements ActionListener {
JFrame frame = new JFrame();
JButton startButton = new JButton("Start");
JLabel text = new JLabel("Studium versenken");
JLabel titelLabel = new JLabel("Studium versenken");
JButton lokalButton = new JButton("Lokal");
JButton multiButton= new JButton("Multiplayer");
JButton soundButton = new JButton();
Font comicSansFont = new Font("Comic Sans MS", Font.BOLD, 45);
MainMenu(){
startButton.setBounds(100,200,200,50);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,500);
frame.setLayout(null);
lokalButton.setBounds(100,200,500,500);
multiButton.setBounds(800,200,500,500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1500,1000);
frame.setVisible(true);
frame.add(startButton);
frame.add(text);
frame.getContentPane().setBackground( Color.decode("#98F5FF"));
frame.add(titelLabel);
frame.add(lokalButton);
frame.add(multiButton);
frame.setLocationRelativeTo(null);
titelLabel.setBounds(500,10,700,100);
titelLabel.setFont(comicSansFont);
lokalButton.setFont(comicSansFont.deriveFont(50f));
multiButton.setFont(comicSansFont.deriveFont(50f));
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == lokalButton){
MainMenu nextMenu= new MainMenu();
}
}
}