Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. package pl.polsl.java.kamil.zietek.lab4.controller.entryPoint;
  2.  
  3. import pl.polsl.java.kamil.zietek.lab4.exception.BadIntegerException;
  4. import pl.polsl.java.kamil.zietek.lab4.view.MainMenuWindow;
  5.  
  6. /**
  7.  * Entry Point of application, with method main.
  8.  *
  9.  * @author Kamil Zietek
  10.  * @version 3.0
  11.  */
  12. public class EntryPoint {
  13.  
  14.     /**
  15.      * Starting method, checks number of players and activates main
  16.      * mainController.
  17.      *
  18.      * @param args[0] number of players, from command line
  19.      */
  20.     public static void main(String[] args) {
  21.         int numberOfPlayers;
  22.         MainMenuWindow window;
  23.         try {
  24.             numberOfPlayers = Integer.parseInt(args[0]);
  25.             window = new MainMenuWindow(numberOfPlayers);
  26.         } catch (ArrayIndexOutOfBoundsException | NumberFormatException | BadIntegerException e) {
  27.             window = new MainMenuWindow();
  28.         }
  29.         window.start();
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement