All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.Match3.src.main.gosu.match3.BoardFrame.gs Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
package match3

uses javax.swing.JFrame
uses javax.swing.JPanel
uses java.awt.BorderLayout
uses java.awt.event.WindowAdapter
uses java.awt.event.WindowEvent

/**
 */
final class BoardFrame extends JFrame {
  construct() {
    super( "Match 3" )
    ContentPane = new JPanel( new BorderLayout() )
    var board = new Board()
    ContentPane.add( board, BorderLayout.CENTER )
    ContentPane.add( new ScoreBoard( board.Model ), BorderLayout.NORTH )
    var timeBoard = new TimeBoard( board.Model )
    ContentPane.add( timeBoard, BorderLayout.SOUTH )
    pack()
    setLocation( 300, 300 )

    addWindowListener( new WindowAdapter() {
      override function windowClosing( e: WindowEvent ) {
        try {
          System.exit( 0 )
        }
        catch( se: SecurityException ) {
          dispose()
        }
      }

      override function windowClosed( e: WindowEvent ) {
        timeBoard.dispose()
      }
    } )
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy