Added simple rendering
This commit is contained in:
@@ -4,11 +4,12 @@
|
||||
package ch.bfh.sevennotseven;
|
||||
|
||||
import java.awt.Frame;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.HeadlessException;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author aaron
|
||||
*
|
||||
@@ -16,6 +17,7 @@ import java.awt.event.WindowEvent;
|
||||
public class Window extends Frame {
|
||||
|
||||
private Game game;
|
||||
private Field field;
|
||||
|
||||
/**
|
||||
* @param title
|
||||
@@ -23,7 +25,7 @@ public class Window extends Frame {
|
||||
*/
|
||||
public Window(String title) throws HeadlessException {
|
||||
super(title);
|
||||
this.setVisible(true);
|
||||
|
||||
this.addWindowListener(new WindowAdapter(){
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e){
|
||||
@@ -31,7 +33,22 @@ public class Window extends Frame {
|
||||
}
|
||||
});
|
||||
|
||||
field = new Field();
|
||||
field.setSize(7);
|
||||
game = new Game();
|
||||
|
||||
|
||||
this.add(field);
|
||||
this.setSize(400,400);
|
||||
this.setVisible(true);
|
||||
|
||||
|
||||
int [][] testfield = new int[7][7];
|
||||
testfield[0][0] = 2;
|
||||
testfield[1][3] = 4;
|
||||
field.setField(testfield);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user