public class MainWindow
extends java.lang.Object
Board
and
the title of the main window using the constructor to this class.
Additionally the subclasses of this class contain the main method
and they start the game thread. A typical example of a subclass of
this class may look like this (assuming that the specialized board
is called MyBoard
.
import java.awt.EventQueue; import de.smits_net.games.framework.board.MainWindow; public class GameMain extends MainWindow { public GameMain() { // pass data to parent constructor and create out board super("Title of a cool game", new MyBoard()); } public static void main(String[] args) { // start the game thread EventQueue.invokeLater(GameMain::new); } }
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JFrame |
frame
The window
|
Constructor and Description |
---|
MainWindow(java.lang.String title,
Board board)
Create a new object.
|
public MainWindow(java.lang.String title, Board board)
title
- Title of the windowboard
- Board to be displayed