Aufräumarbeiten

buttonActions
Matias 2025-06-18 22:43:15 +02:00
parent 01ed4f0a91
commit 6c2ef85556
2 changed files with 2 additions and 42 deletions

View File

@ -1,15 +1,11 @@
package de.mannheim.th.chess.ui; package de.mannheim.th.chess.ui;
import java.awt.EventQueue;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File; import java.io.File;
@ -20,10 +16,8 @@ import javax.swing.BoxLayout;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Font; import java.awt.Font;
import java.awt.Graphics;
import java.awt.Color; import java.awt.Color;
public class MainFrame extends JFrame { public class MainFrame extends JFrame {
@ -33,22 +27,6 @@ public class MainFrame extends JFrame {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private JPanel contentPane; private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainFrame frame = new MainFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/** /**
* Create the frame. * Create the frame.
*/ */

View File

@ -35,12 +35,10 @@ public class SpielFrame extends JFrame {
private static final Logger logger = LogManager.getLogger(App.class); private static final Logger logger = LogManager.getLogger(App.class);
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private JPanel contentPane;
private ArrayList<JButton> buttons = new ArrayList<>(); private ArrayList<JButton> buttons = new ArrayList<>();
private HashMap<JButton, String> belegungen = new HashMap<>(); private HashMap<JButton, String> belegungen = new HashMap<>();
private JPanel panelLinks, panelRechts; private JPanel panelLinks, panelRechts, contentPane;
private Game game; private Game game;
private String symbolChoosed;
private BoardMode mode; private BoardMode mode;
private Square selectedSquare; private Square selectedSquare;
@ -49,22 +47,6 @@ public class SpielFrame extends JFrame {
normal, pieceSelected, finished normal, pieceSelected, finished
} }
/**
* Launch the application. Die Main-Methode für den WindowBuilder.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
SpielFrame frame = new SpielFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/** /**
* Create the frame. * Create the frame.
*/ */
@ -78,7 +60,7 @@ public class SpielFrame extends JFrame {
setTitle("Schach"); setTitle("Schach");
setAlwaysOnTop(true); setAlwaysOnTop(true);
JPanel contentPane = new JPanel(); contentPane = new JPanel();
contentPane.setLayout(new BorderLayout()); contentPane.setLayout(new BorderLayout());
setContentPane(contentPane); setContentPane(contentPane);