Browse Source

init GameWindow

feature_solitaer_001
Alexander Hartung 3 years ago
parent
commit
25f30237d2
  1. 22
      .gitignore
  2. 27
      src/main/java/hauptmenue/GameWindow.java
  3. 10
      src/main/java/hauptmenue/main.java
  4. 28
      src/main/java/solitaer/SolitaerGamePanel.java

22
.gitignore

@ -23,3 +23,25 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# End of https://www.toptal.com/developers/gitignore/api/maven

27
src/main/java/hauptmenue/GameWindow.java

@ -0,0 +1,27 @@
package hauptmenue;
import java.awt.Dimension;
import javax.swing.JFrame;
import solitaer.SolitaerGamePanel;
public class GameWindow extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private final SolitaerGamePanel gamePanel = new SolitaerGamePanel();
public GameWindow() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gamePanel.setPreferredSize(new Dimension(1180, 780));
add(gamePanel);
pack();
setVisible(true);
}
}

10
src/main/java/hauptmenue/main.java

@ -0,0 +1,10 @@
package hauptmenue;
public class main {
public static void main(String[] args) {
// TODO Auto-generated method stub
new GameWindow();
}
}

28
src/main/java/solitaer/SolitaerGamePanel.java

@ -0,0 +1,28 @@
package solitaer;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class SolitaerGamePanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
public SolitaerGamePanel() {
setLayout(null);
}
@Override
protected void paintComponent(Graphics g) {
// TODO Auto-generated method stub
super.paintComponent(g);
g.setColor(Color.green);
g.fillRect(0, 0, this.getWidth(), this.getHeight());
}
}
Loading…
Cancel
Save