Newer
Older
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package GUI.game;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
/**
*
* @author Kovax
*/
public class View extends Window
{
private Controller controller;
private Model model;
public View(Controller game, Model gameModel)
this.model = gameModel;
this.controller = game;
this.setLayout(new GridLayout(controller.settings.size,controller.settings.size));
model.build();
for(int i=0;i<controller.settings.size;i++)
{
for(JButton actButton : model.squares[i])
{
this.add(actButton);
}
}
if( this.frame != null )
{
frame.dispose();
}
this.frame = new JFrame("Aknakereső");
frame.add(this);
frame.setSize(400,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}