Gamegui Button anpassen

This commit is contained in:
zhe 2021-12-13 09:41:27 +01:00
parent b607886184
commit 75096139ac

View File

@ -11,28 +11,30 @@ public class GameGui {
public GameGui(){
frame = new JFrame("Tetris");
JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createMatteBorder(400, 10, 10, 10,Color.black));
panel.setBorder(BorderFactory.createMatteBorder(500, 10, 10, 50,Color.black));
//Label
JLabel label = new JLabel(" Ihr Name:");
panel.add(label);
//JLabel label = new JLabel(" Ihr Name:");
//panel.add(label);
//Textfeld
JTextField tfName = new JTextField("Bitte Name eingeben");
tfName.setForeground(Color.white);
//JTextField tfName = new JTextField("Bitte Name eingeben");
//tfName.setForeground(Color.white);
// Hintergrundfarbe wird gesetzt
tfName.setBackground(Color.GRAY);
// tfName.setBackground(Color.GRAY);
// Textfeld wird unserem Panel hinzugefügt
panel.add(tfName);
//panel.add(tfName);
//Button
JButton button1 = new JButton("Start");
button1.setPreferredSize( new Dimension(150,50));
//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));
//Button untereinander
panel.setLayout(new GridLayout(0,1));
panel.setBackground(Color.LIGHT_GRAY);
panel.add(button1);
//panel.add(button1);
panel.add(button2);
panel.add(button3);