Menue Start

This commit is contained in:
Jonas Dernedde 2021-12-13 09:44:33 +01:00
parent 75096139ac
commit 921b25d601
5 changed files with 28 additions and 0 deletions

View File

@ -38,6 +38,8 @@ public class GameGui {
panel.add(button2);
panel.add(button3);
frame.add(panel,BorderLayout.EAST);
frame.setSize(width,height);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

26
src/Tetris/Menue.java Normal file
View File

@ -0,0 +1,26 @@
package Tetris;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Menue {
public static void main(final String[] args) {
final JFrame parent = new JFrame();
JButton button = new JButton();
button.setText("Namen Eingeben");
parent.add(button);
parent.pack();
parent.setVisible(true);
button.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
String name = JOptionPane.showInputDialog(parent,
"What is your name?", null);
}
});
}
}