Basic main menu changes
disable sound test in "HalloSchiffeVersenken"
This commit is contained in:
parent
d1f9ff5984
commit
372a29698a
|
@ -5,7 +5,7 @@ public class HalloSchiffeVersenken {
|
||||||
|
|
||||||
System.out.println("HelloSchiffeVersenekn");
|
System.out.println("HelloSchiffeVersenekn");
|
||||||
|
|
||||||
|
/**
|
||||||
System.out.println("sound");
|
System.out.println("sound");
|
||||||
SoundHandler.playSound("hit");
|
SoundHandler.playSound("hit");
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
|
@ -14,6 +14,7 @@ public class HalloSchiffeVersenken {
|
||||||
SoundHandler.setSoundOn(false);
|
SoundHandler.setSoundOn(false);
|
||||||
System.out.println("sound off");
|
System.out.println("sound off");
|
||||||
SoundHandler.playSound("hit");
|
SoundHandler.playSound("hit");
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -6,23 +7,37 @@ import javax.swing.*;
|
||||||
|
|
||||||
public class MainMenu implements ActionListener {
|
public class MainMenu implements ActionListener {
|
||||||
JFrame frame = new JFrame();
|
JFrame frame = new JFrame();
|
||||||
JButton startButton = new JButton("Start");
|
JLabel titelLabel = new JLabel("Studium versenken");
|
||||||
JLabel text = 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(){
|
MainMenu(){
|
||||||
startButton.setBounds(100,200,200,50);
|
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
frame.setSize(500,500);
|
|
||||||
frame.setLayout(null);
|
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.setVisible(true);
|
||||||
frame.add(startButton);
|
frame.getContentPane().setBackground( Color.decode("#98F5FF"));
|
||||||
frame.add(text);
|
|
||||||
|
frame.add(titelLabel);
|
||||||
|
frame.add(lokalButton);
|
||||||
|
frame.add(multiButton);
|
||||||
frame.setLocationRelativeTo(null);
|
frame.setLocationRelativeTo(null);
|
||||||
|
titelLabel.setBounds(500,10,700,100);
|
||||||
|
titelLabel.setFont(comicSansFont);
|
||||||
|
lokalButton.setFont(comicSansFont.deriveFont(50f));
|
||||||
|
multiButton.setFont(comicSansFont.deriveFont(50f));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if(e.getSource() == lokalButton){
|
||||||
|
MainMenu nextMenu= new MainMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue