Menü background

This commit is contained in:
zhe 2021-12-13 11:21:06 +01:00
parent 89a3585544
commit ce85efaf76
3 changed files with 15 additions and 11 deletions

View File

@ -27,18 +27,16 @@ public class GameGui {
//Button
//JButton button1 = new JButton("Start");
//button1.setPreferredSize( new Dimension(150,50));
JButton button2 = new JButton("Pause");
button2.setPreferredSize( new Dimension(100,30));
JButton button3 = new JButton("Score");
button3.setPreferredSize( new Dimension(100,30));
JButton buttonPause = new JButton("Pause");
buttonPause.setPreferredSize( new Dimension(100,30));
JButton buttonScore = new JButton("Score");
buttonScore.setPreferredSize( new Dimension(100,30));
//Button untereinander
panel.setLayout(new GridLayout(0,1));
panel.setBackground(Color.LIGHT_GRAY);
panel.setBackground(Color.YELLOW);
//panel.add(button1);
panel.add(button2);
panel.add(button3);
panel.add(buttonPause);
panel.add(buttonScore);
frame.add(panel,BorderLayout.EAST);
frame.setSize(width,height);

View File

@ -3,14 +3,17 @@ package Tetris;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import java.awt.*;
public class Menue {
public static void main(final String[] args) {
final JFrame parent = new JFrame();
public Menue(){
JFrame parent = new JFrame("Tetris Menü");
JButton button = new JButton();
button.setText("Namen Eingeben");
button.setPreferredSize(new Dimension(550,650));
button.setBackground(Color.CYAN);
parent.add(button);
parent.pack();
parent.setVisible(true);
@ -23,4 +26,7 @@ public class Menue {
}
});
}
public static void main(final String[] args) {
new Menue();
}
}