login hintergrund

master
leventius imperatus 2020-06-07 22:11:07 +02:00
parent 963c537de6
commit 75f9b0cab3
4 changed files with 33 additions and 13 deletions

BIN
assets/hintergrund.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

1
bin/.gitignore vendored
View File

@ -1,3 +1,4 @@
/MapMenu$1.class /MapMenu$1.class
/MapMenu.class /MapMenu.class
/Portal.class /Portal.class
/Hintergrund.class

19
src/Hintergrund.java Normal file
View File

@ -0,0 +1,19 @@
// Diese Klasse stellt die einzelnen Bicks (Wände) auf der Map dar.
public class Hintergrund extends Picture {
private static final long serialVersionUID = -8813034369041822237L;
public int xPos;
public int yPos;
public Hintergrund() {
super("hintergrund");
}
}

View File

@ -2,7 +2,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File; import java.io.File;
import java.sql.SQLException; import java.sql.SQLException;
import javax.imageio.ImageIO;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -11,16 +11,13 @@ import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
public class MapMenu extends JFrame { public class MapMenu extends JFrame {
/**
*
*/
private static final long serialVersionUID = 2863784680171430142L; private static final long serialVersionUID = 2863784680171430142L;
public boolean rdy; public boolean rdy;
JButton button; JButton button;
Hintergrund hintergrund;
JPanel panel; JPanel panel;
JComboBox<?> bob; JComboBox<?> bob;
@ -34,13 +31,11 @@ public class MapMenu extends JFrame {
String selectedMap; String selectedMap;
public MapMenu() { public MapMenu() {
super("Map Menu"); super("Map Menu");
System.setProperty("sun.java2d.opengl", "true"); System.setProperty("sun.java2d.opengl", "true");
path = new File("assets/maps"); path = new File("assets/maps");
maps = path.list(); maps = path.list();
@ -59,8 +54,13 @@ public class MapMenu extends JFrame {
this.setContentPane(panel); this.setContentPane(panel);
this.getContentPane().setLayout(null); this.getContentPane().setLayout(null);
hintergrund = new Hintergrund();
panel.add(hintergrund);
hintergrund.setBounds(0, 0, 300, 200);
button = new JButton("Launch"); button = new JButton("Launch");
panel.add(button); panel.add(button);
button.setBounds(70, 50, 120, 30); button.setBounds(70, 50, 120, 30);
button.addActionListener(new ActionListener() { button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -71,22 +71,22 @@ public class MapMenu extends JFrame {
} }
} }
}); });
bob = new JComboBox<Object>(maps); bob = new JComboBox<Object>(maps);
bob.setSelectedItem("Original"); bob.setSelectedItem("Original");
panel.add(bob); panel.add(bob);
bob.setBounds(70, 10, 120, 30); bob.setBounds(70, 10, 120, 30);
} }
public String getSelectedMap() { public String getSelectedMap() {
return selectedMap; return selectedMap;
} }
// Was passieren soll, wenn der Button gedrückt wird // Was passieren soll, wenn der Button gedrückt wird
public void button_ActionPerformed(ActionEvent evt) throws SQLException { public void button_ActionPerformed(ActionEvent evt) {
selectedMap = String.valueOf(bob.getSelectedItem()); selectedMap = String.valueOf(bob.getSelectedItem());
rdy = true; rdy = true;
this.setVisible(false); this.setVisible(false);
} }