Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

343
Visualizações
How to passing arguments in a JavaFX project on Netbeans?

I am working on a Warlords game, based on JavaFX, where I am making a LAN version (client-server) from a single-machine one.

The problem is that I cannot input the program arguments with the same way as in a classical Java project. Plus, I have no problems for passing arguments in command line (including JavaFX projects), like :

$ java -classpath Classes/ warlords.client.game.Main --address=127.0.0.1 --name=Barspicer9

But when I run the project from Netbeans, it looks like the arguments are not handled properly. For example :

String ipAddress = "localhost";
static String player = "anonimus";

for (String arg : args) {
    // Check if the current argument begins with "--address=" or "--name="
    if (arg.startsWith("--address=")) {
        // 10 characters before server address
        ipAddress = arg.substring(10);
    } 
    else if (arg.startsWith("--name=")) {
        // 7 characters before player name
        player = arg.substring(7);
    }
}

The server terminal outputs (with the arguments specified above):

Player connected : "anonimus"

And the client terminal outputs :

Trying to connect to the server : rmi://localhost/TestServeur ... 
Connection done

There is the configuration window on a classic Java project : Classic Java - Project Properties

And there is the configuration window on a JavaFX project : JavaFX - Project Properties

The "Arguments" does not displayed in the second window, instead there is another field named "Parameters", but not directly editable. Is it an equivalent to the "Arguments" field in the first window ? How can I input these arguments, if the "Parameters" field in the second window is not equivalent ?

Thanks in advance.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda