@Override
    public void run() 
    {
        while(System.currentTimeMillis() < (time+5000))
        {
            switch(functionName)
            {
                case "IP":
                {
                    try {
                        x.connectIP();
                    } catch (Exception ex) {
                        Logger.getLogger(Connecter.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }break;
                case "SERVER":
                {
                    try {
                        x.connectServer();
                    } catch (Exception ex) {
                        Logger.getLogger(Connecter.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }
        if(x.connection.isConnected()==false)
        {JOptionPane.showMessageDialog(null, "Request timeout.");}
    }