/** * Starts up the client and connects it to the server, then sets up the GUI and commands it to * build itself. */ public void start() { serverConnection = new ClientConnection("127.0.0.1", 13337); serverConnection.startConnection(); SwingGUI gui = new SwingGUI(); setGUI(gui); gui.setController(this); viewAllContacts(); gui.buildGUI(); }
public static void main(String[] args) { if (args.length > 0 && (args[0].contains("--version") || args[0].contains("--help"))) SwingGUI.main(args); else if (args.length < 14) { System.out.println( "\nusage:\t cWatchTheHamsterClient --username USER" + " --password PASSWORD --server WWW.EXAMPLE.COM " + "--port 6666 --resolution 320x240 --fps 1 --dev 0" + " [--verbose]"); StartGUI inst = new StartGUI(); try { SwingUtilities.invokeAndWait(inst); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } SwingGUI.main(inst.getNewArgs()); } else SwingGUI.main(args); }
/** Refreshes the table with the locally stored contacts. */ public void refreshGUI() { updateTableData(convertToTableVector(contacts)); gui.refreshTable(); }
/** * Set tableData in the GUI. * * @param tableData */ private void updateTableData(Vector<Vector<String>> tableData) { gui.setTableData(tableData); }
/** Makes the GUI bring up a warning prompt when a contact is out of sync. */ public void outOfSyncWarning() { gui.outOfSyncWarning(); }