⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jcapp.java

📁 这是自己在学习编写下象棋时参考过的很好的程序。
💻 JAVA
字号:
/****************************************************************************** * jcApp.java - The JavaChess main program * by F.D. Laram閑 * * Purpose: Entry point, and not much else! * * History: * 07.06.00 Initial build. *****************************************************************************/package javachess;import javax.swing.UIManager;import java.awt.*;import javachess.jcGame;/***************************************************************************** * public class jcApp * The application-level class, surrounding everything else. * * Most of this code has been auto-generated by JBuilder; my role was limited * to re-formatting it to make it legible, and to add the jcGame calls at the * end of the main program. ****************************************************************************/public class jcApp{  // Constructor  public jcApp()  {    // Make the window, since Java needs one    // We won't be making much use of it, though; all of the i/o    // will pass through the console    jcFrame frame = new jcFrame();    frame.validate();    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();    Dimension frameSize = frame.getSize();    if ( frameSize.height > screenSize.height )    {      frameSize.height = screenSize.height;    }    if ( frameSize.width > screenSize.width )    {      frameSize.width = screenSize.width;    }    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);    frame.setVisible( true );  }  // Main method  // Initialize and launch the jcGame object  public static void main( String[] args )  {    // Extract the parameters    String openingBook = args[ 0 ];    String startingPos = "NONE";    if ( args.length > 1 )      startingPos = args[ 1 ];    // Make the application    try    {      UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );    }    catch( Exception e )    {      e.printStackTrace();    }    new jcApp();    // Initialize the game controller    jcGame theGame = new jcGame();    try    {      theGame.InitializeGame( openingBook, startingPos );    }    catch( Exception e )    {      e.printStackTrace();    }    // Run the game    try    {      theGame.RunGame();    }    catch( Exception e )    {      e.printStackTrace();    }    System.exit( 0 );  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -