private void jButton1ConnectActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ConnectActionPerformed try { client.connect("christoffer2000.cloudapp.net", 9090); new Thread(client).start(); } catch (IOException ex) { Logger.getLogger(View.class.getName()).log(Level.SEVERE, null, ex); } } // GEN-LAST:event_jButton1ConnectActionPerformed
/** Creates new form View */ public View() { initComponents(); client = new EchoClient(); client.addObserver(this); }
@Override public void update(Observable o, Object o1) { ReceiveText.setText(client.receive()); }
private void jButton1SendActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1SendActionPerformed client.MsgOut(SendText.getText()); } // GEN-LAST:event_jButton1SendActionPerformed