package ttaomae.connectn.network.client;

import java.io.IOException;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class Main extends Application
{
    @Override
    public void start(Stage stage) throws Exception
    {
        stage.setTitle("Client");

        BorderPane root = new BorderPane();
        root.setCenter(new ClientPanel("localhost", 4200));

        stage.setScene(new Scene(root, 450, 400));
        stage.show();
    }

    public static void main(String[] args) throws IOException
    {
        launch(args);
    }
}

@@ -62,16 +62,39 @@
 ception;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -260,16 +260,66 @@
 ation%0A%7B%0A
+    private static final int DEFAULT_PORT = 4200;%0A
     @Ove
@@ -374,32 +374,494 @@
 Exception%0A    %7B%0A
+        // get host and port from parameters%0A        List%3CString%3E args = getParameters().getRaw();%0A        String hostname = %22localhost%22;%0A        int portNumber = DEFAULT_PORT;%0A        if (args.size() == 2) %7B%0A            hostname = args.get(0);%0A            try %7B%0A                portNumber = Integer.parseInt(args.get(0));%0A            %7D catch (NumberFormatException e) %7B%0A                System.err.println(%22Using default port number.%22);%0A            %7D%0A        %7D%0A%0A
         stage.se
@@ -966,30 +966,32 @@
 nel(
-%22localhost%22, 4200
+hostname, portNumber
 ));%0A
-%0A
     

add optional parameters to client Main