This commit is contained in:
zhe 2021-11-16 11:18:51 +01:00
parent 626f2124ea
commit 5e7f03746e
4 changed files with 14 additions and 7 deletions

View File

@ -36,7 +36,7 @@ public class Board extends JPanel
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.DARK_GRAY);
g.setColor(Color.lightGray);
//shape mit 2-Forschleife
for(int row=0;row< shape.length;row++){

View File

@ -10,19 +10,26 @@ public class GameGui {
public GameGui(){
JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createMatteBorder(450, 10, 20, 10,Color.black));
panel.setBorder(BorderFactory.createMatteBorder(400, 10, 20, 10,Color.black));
//Label
JLabel label = new JLabel(" Ihr Name:");
panel.add(label);
//Textfeld
JTextField tfName = new JTextField("Bitte Name eingeben");
tfName.setForeground(Color.white);
// Hintergrundfarbe wird gesetzt
tfName.setBackground(Color.GRAY);
// Textfeld wird unserem Panel hinzugefügt
panel.add(tfName);
JLabel label = new JLabel("Name: ",JLabel.LEFT);
label.setBounds(100,100,50,30);
//Button
JButton button1 = new JButton("Start");
button1.setPreferredSize( new Dimension(150,150));
JButton button2 = new JButton("Pause");
JButton button3 = new JButton("Score");
panel.setLayout(new GridLayout(0,1));
panel.setBackground(Color.gray);
panel.add(label);
panel.setBackground(Color.LIGHT_GRAY);
panel.add(button1);
panel.add(button2);
panel.add(button3);