예제 #1
0
  /**
   * Method called when Disconnect button is pressed
   *
   * @param evt
   */
  private void jButton4ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton4ActionPerformed
    try {
      if (this.gui.controller.Language == "English") {
        appendjTextPane1("Me : ", 2); // Or gui.getUser() ;)
      } else if (this.gui.controller.Language == "Francais") {
        appendjTextPane1("Moi : ", 2); // Or gui.getUser() ;)
      }
      appendjTextPane1("GoodBye, I'm " + gui.getUser(), 0);
      appendjTextPane1("\n", 0);
    } catch (BadLocationException ex) {
      Logger.getLogger(ChatGUI.class.getName()).log(Level.SEVERE, null, ex);
    }

    gui.performDisconnect(gui.getUser());
    if (this.gui.controller.Language == "English") {
      JOptionPane.showMessageDialog(this, "You have been successfully disconnected.");
    } else if (this.gui.controller.Language == "Francais") {
      JOptionPane.showMessageDialog(this, "vous avez bien été déconnecté.");
    }
  } // GEN-LAST:event_jButton4ActionPerformed