Problem mit Button und Label
This commit is contained in:
parent
e451450be6
commit
d8d6b9d33c
Binary file not shown.
Binary file not shown.
@ -12,17 +12,17 @@ public class GameGui {
|
|||||||
|
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setBorder(BorderFactory.createMatteBorder(400, 10, 10, 10,Color.black));
|
panel.setBorder(BorderFactory.createMatteBorder(400, 10, 10, 10,Color.black));
|
||||||
|
/*
|
||||||
//Label
|
//Label
|
||||||
JLabel label = new JLabel(" Ihr Name:");
|
JLabel label = new JLabel(" Ihr Name:");
|
||||||
panel.add(label);
|
panel.add(label);
|
||||||
//Textfeld
|
//Textfeld
|
||||||
//JTextField tfName = new JTextField("Bitte Name eingeben");
|
JTextField tfName = new JTextField("Bitte Name eingeben");
|
||||||
//tfName.setForeground(Color.white);
|
tfName.setForeground(Color.white);
|
||||||
// Hintergrundfarbe wird gesetzt
|
// Hintergrundfarbe wird gesetzt
|
||||||
//tfName.setBackground(Color.GRAY);
|
tfName.setBackground(Color.GRAY);
|
||||||
// Textfeld wird unserem Panel hinzugefügt
|
// Textfeld wird unserem Panel hinzugefügt
|
||||||
//panel.add(tfName);
|
panel.add(tfName);
|
||||||
|
|
||||||
//Button
|
//Button
|
||||||
JButton button1 = new JButton("Start");
|
JButton button1 = new JButton("Start");
|
||||||
@ -35,7 +35,7 @@ public class GameGui {
|
|||||||
panel.add(button1);
|
panel.add(button1);
|
||||||
panel.add(button2);
|
panel.add(button2);
|
||||||
panel.add(button3);
|
panel.add(button3);
|
||||||
|
*/
|
||||||
frame = new JFrame("Tetris");
|
frame = new JFrame("Tetris");
|
||||||
frame.add(panel,BorderLayout.EAST);
|
frame.add(panel,BorderLayout.EAST);
|
||||||
frame.setSize(width,height);
|
frame.setSize(width,height);
|
||||||
|
Loading…
Reference in New Issue
Block a user