/Users/petercappello/NetBeansProjects/56-2014/56-2014-4-AdaptableZapem/src/App.java |
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
The class that integrates the components of the Zap 'em game.
@author
public class App extends JFrame
{
private final ControlPanel controlPanel;
private final Game game;
private final View view;
App()
{
game = new Game();
view = new View( game, game.getImage() );
controlPanel = new ControlPanel( view, game );
setTitle( "Super Zap 'em!" );
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
add( view, BorderLayout.CENTER );
add( controlPanel, BorderLayout.SOUTH );
Dimension dimension = new Dimension( Game.IMAGE_SIZE, Game.IMAGE_SIZE + controlPanel.getHeight() );
setSize( dimension );
setPreferredSize( dimension );
setVisible( true );
}
Instantiate a Zap 'em game.
@param args
public static void main( String[] args ) { App app = new App(); }
}