public ServerGUI() {
        
    	
    	
        field = new JTextField("6060",10);
        field.setHorizontalAlignment(JTextField.RIGHT);
        field.setBorder(BorderFactory.createTitledBorder("Inserisci la porta"));
        field.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();
                if  (! (c>='0' && c <='9') || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
                	getToolkit().beep();
                	e.consume();
                }
            }
        });
        
        portDatagram = new JTextField("-1",10);
        portDatagram.setHorizontalAlignment(JTextField.RIGHT);
        portDatagram.setBorder(BorderFactory.createTitledBorder("Inserisci la porta datagram"));
        portDatagram.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();
                if  (! (c>='0' && c <='9') || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
                	getToolkit().beep();
                	e.consume();
                }
            }
        });
        
    	
    	start = new JButton("Avvio server");
        start.setVerticalTextPosition(AbstractButton.CENTER);
        start.setHorizontalTextPosition(AbstractButton.LEADING);
        

        stop = new JButton("Stop Server");
        stop.setVerticalTextPosition(AbstractButton.BOTTOM);
        stop.setHorizontalTextPosition(AbstractButton.CENTER);
        
        
        label = new JLabel("Status: da avviare");
        
        enableHttps = new JCheckBox("Enable Https",true);
        enableAuthentication = new JCheckBox("Enable Authentication",true);

        start.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					int port = Integer.parseInt(field.getText());
					int portDatagramInt = Integer.parseInt(portDatagram.getText());
					boolean enableHttpsB = enableHttps.isSelected();
					boolean enableAuthenticationB = enableAuthentication.isSelected();
					server = new Server(port,enableAuthenticationB,enableHttpsB,portDatagramInt);
					server.start();
					label.setText("Status: avviato");
				} catch (Exception e1) {
					label.setText(e1.getMessage());
					e1.printStackTrace();
				}
			}
		});
        stop.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				server.stop();
				server = null;
				label.setText("Status: stoppato");
				
			}
		});

        //Listen for actions on buttons 1 and 3.
        

        

        //Add Components to this container, using the default FlowLayout.
        add(field);
        add(portDatagram);
        add(enableHttps);
        add(enableAuthentication);
        add(start);
        add(stop);
        add(label);
    }