room.morphToClientMode();
SwingHelper.edtInvokeLater(new Runnable() { @Override public void run() {
setupConnectionStatusListeners();
String serverAddress = "";
try {
RemoteReceiver receiver = room.clientCurrentConsole().remoteReceiver();
serverAddress = clientServerAddressTf.getText().trim();
receiver.connect(serverAddress);
closeAction();
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Connection failed: " + serverAddress + "\n" + ex, "javatari P2 Client", JOptionPane.ERROR_MESSAGE);
room.morphToStandaloneMode();
}
refreshMultiplayer();
gray(false);
}});
} else { // Will try to DISCONNECT
try {
RemoteReceiver receiver = room.clientCurrentConsole().remoteReceiver();
receiver.disconnect();
room.morphToStandaloneMode();
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error disconnecting from Server:\n" + ex, "javatari P2 Client", JOptionPane.ERROR_MESSAGE);
}
refreshMultiplayer();