This commit is contained in:
Fabian Keller
2020-12-03 09:30:29 +01:00
4 changed files with 65 additions and 42 deletions

View File

@@ -13,6 +13,7 @@ public class Spielerverwaltung {
//
private int level;
private String name;
/**
* arraylist von Spieler
*/
@@ -47,6 +48,15 @@ public class Spielerverwaltung {
public int getLevel () {
return level;
}
/**
* Get the value of level
* @return the value of level
*/
public String getName () {
return name;
}
/**
* Set the value of spieler

View File

@@ -1,22 +1,33 @@
package de.jaujau.gui;
import java.util.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
/**
* Class GUI
*/
public class GUI {
public class GUI extends JFrame implements ActionListener{
//
// Fields
//
private static final long serialVersionUID = 1L;
//
// Constructors
//
public GUI () { };
public GUI () { }
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
//
// Methods

View File

@@ -16,6 +16,11 @@ import java.awt.Dimension;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import de.jaujau.daten.Spielerverwaltung;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
@@ -25,30 +30,24 @@ import java.net.URL;
import java.awt.Component;
import java.awt.Font;
public class Menue_GUI {
public class Menue_GUI extends JFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private Spielerverwaltung spielerverwaltung;
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Menue_GUI window = new Menue_GUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
* @param speicherung
*/
public Menue_GUI() {
public Menue_GUI(Spielerverwaltung speicherung) {
this.spielerverwaltung = speicherung;
speicherung.getSpieler();
initialize();
}
@@ -120,4 +119,10 @@ public class Menue_GUI {
frame.getContentPane().add(panel_main, BorderLayout.CENTER);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
}

View File

@@ -5,6 +5,7 @@ import java.util.*;
import de.jaujau.daten.Spielerverwaltung;
import de.jaujau.daten.Texturenpakete;
import de.jaujau.gui.GUI;
import de.jaujau.gui.Menue_GUI;
/**
@@ -19,12 +20,17 @@ public class Anwendung {
private Spiel aktuellesSpiel;
private Texturenpakete texturenpakete;
private Spielerverwaltung speicherung;
private GUI gui;
private Menue_GUI gui;
//
// Constructors
//
public Anwendung () { };
public Anwendung () {
speicherung = new Spielerverwaltung();
gui = new Menue_GUI(speicherung);
};
//
// Methods
@@ -83,30 +89,21 @@ public class Anwendung {
return speicherung;
}
/**
* Set the value of gui
* @param newVar the new value of gui
*/
public void setGui (GUI newVar) {
gui = newVar;
}
/**
* Get the value of gui
* @return the value of gui
*/
public GUI getGui () {
return gui;
}
//
// Other methods
//
/**
*/
public void main()
/**
* Launch the application.
*/
public static void main(String[] args)
{
System.out.println("Hallo Welt");
Anwendung jaujau = new Anwendung();
jaujau.gui.setVisible(true);
}