public void connect() { if (Client.instance() == null) { new Thread( new Runnable() { public void run() { try { new Client(server, channel, name); } catch (IOException e) { e.printStackTrace(); } catch (IrcException e) { e.printStackTrace(); } } }) .start(); while (Client.instance() == null) sleep(50); } Client.instance().showGui(); if (Client.instance().isConnected()) return; try { while (Gui.instance() == null || Gui.instance().userListPane == null) sleep(50); Client.instance().join(); } catch (IOException e) { e.printStackTrace(); } catch (IrcException e) { e.printStackTrace(); } }
public void openGui() { if (Client.instance() != null) Client.instance().showGui(); }
public void onFinish() { if (Client.instance() != null) Client.instance().closeGui(); }