Browse Source

refactoring: Change the name of JFrame to Frame

master
Leon Montag 2 years ago
parent
commit
02f2d146ed
  1. 16
      src/main/java/Gui/gui.java
  2. 4
      src/test/java/Gui/guiTest.java
  3. BIN
      target/MiniGameProject-1.0-SNAPSHOT.jar
  4. 2
      target/maven-archiver/pom.properties
  5. 1
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

16
src/main/java/Gui/gui.java

@ -11,7 +11,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
public class gui { public class gui {
public static JFrame jf;
public static JFrame Frame;
public static JButton StartBtn, CloseBtn; public static JButton StartBtn, CloseBtn;
public static JPanel Panel; public static JPanel Panel;
public static JLabel Label; public static JLabel Label;
@ -23,11 +23,11 @@ public class gui {
createPanel(); createPanel();
} }
public void createFrame(){ public void createFrame(){
jf = new JFrame("Wer wird Millionr");
jf.setSize(width,height);
jf.setLocationRelativeTo(null);
jf.setResizable(false);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame = new JFrame("MiniGames");
Frame.setSize(width,height);
Frame.setLocationRelativeTo(null);
Frame.setResizable(false);
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} }
public void createButtons() { public void createButtons() {
@ -54,8 +54,8 @@ public class gui {
Panel.add(Label,gbc); Panel.add(Label,gbc);
Panel.add(StartBtn,gbc); Panel.add(StartBtn,gbc);
Panel.add(CloseBtn,gbc); Panel.add(CloseBtn,gbc);
jf.add(Panel);
jf.setVisible(true);
Frame.add(Panel);
Frame.setVisible(true);
Panel.setVisible(true); Panel.setVisible(true);
} }

4
src/test/java/Gui/guiTest.java

@ -19,8 +19,8 @@ class guiTest {
int FrameWitdh = 800; int FrameWitdh = 800;
int FrameHeight = 600; int FrameHeight = 600;
//act //act
assertEquals(FrameWitdh, gui.jf.getWidth());
assertEquals(FrameHeight, gui.jf.getHeight());
assertEquals(FrameWitdh, gui.Frame.getWidth());
assertEquals(FrameHeight, gui.Frame.getHeight());
} }
} }

BIN
target/MiniGameProject-1.0-SNAPSHOT.jar

2
target/maven-archiver/pom.properties

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Fri Dec 30 01:11:12 CET 2022
#Fri Dec 30 10:15:22 CET 2022
groupId=MiniGameProject groupId=MiniGameProject
artifactId=MiniGameProject artifactId=MiniGameProject
version=1.0-SNAPSHOT version=1.0-SNAPSHOT

1
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -1,3 +1,4 @@
C:\Users\Leon\MiniGameProject\src\main\java\Gui\ActionHandler.java C:\Users\Leon\MiniGameProject\src\main\java\Gui\ActionHandler.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\gui.java C:\Users\Leon\MiniGameProject\src\main\java\Gui\gui.java
C:\Users\Leon\MiniGameProject\src\main\java\main.java C:\Users\Leon\MiniGameProject\src\main\java\main.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\StartGameGui.java
Loading…
Cancel
Save