Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Invia/Ricevi File - Main.java

Main.java

Caricato da: Mutelg
Scarica il programma completo

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package testinviofile;
  7. import javax.swing.JOptionPane;
  8. /**
  9.  *
  10.  * @author Administrator
  11.  */
  12. public class Main {
  13.  
  14.     /**
  15.      * @param args the command line arguments
  16.      */
  17.     public static void main(String[] args) {
  18.      
  19.    Object[] options = {"Server", "Client"};
  20.    int scelta = JOptionPane.showOptionDialog(null, "Cosa sei Client o Server?", "Giocare",
  21.         JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
  22.         null, options, options[1]);
  23.    System.out.println(scelta);
  24.    switch(scelta){
  25.        case 0:{
  26.                Server.server();
  27.                break;
  28.               }
  29.        case 1:{
  30.                Client.client();
  31.                break;
  32.               }
  33.        case -1:{
  34.                System.out.println("Programma Chiuso senza aver effettuato nessuna operazione!");
  35.                break;
  36.               }
  37.        }
  38.        }
  39.    }