Exemplo n.º 1
0
 void jList1_mouseClicked(MouseEvent e) {
   int indx = jList1.getLeadSelectionIndex();
   jTextPane2.setText(((applicant) appList.elementAt(indx)).getDescription());
   try {
     currPicture =
         new ImageIcon(
             "../Blackwood Client/src/edu/nodak/ndsu/cs/lions/blackwood/Resources/Image/people/"
                 + ((applicant) jList1.getSelectedValue()).Picture
                 + ".gif");
     repaint();
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Exemplo n.º 2
0
 private void handleConnect() {
   if (jToggleButtonConnect.isSelected() || jMenuItemServerConnect.isEnabled())
     try {
       jTextPaneDisplayMessages.setText("");
       session = new Session();
       try {
         String userid = jTextFieldUser.getText();
         if (jPasswordFieldPwd.getPassword() != null) {
           String pwd = String.valueOf(jPasswordFieldPwd.getPassword()).trim();
           if (!pwd.equals("")) {
             userid += ":" + pwd;
           }
         }
         if (session.connect(jTextFieldServer.getText(), userid)) {
           displayMessage("Connected\n", incomingMsgAttrSet);
           session.addListener(this);
           jToggleButtonConnect.setText("Disconnect");
           jMenuItemServerConnect.setEnabled(false);
           jMenuItemServerDisconnect.setEnabled(true);
         } else {
           jToggleButtonConnect.setSelected(false);
           jMenuItemServerConnect.setEnabled(true);
           jMenuItemServerDisconnect.setEnabled(false);
           displayMessage("Connection attempt failed\n", offlineClientAttrSet);
         }
       } catch (ConnectionException ex1) {
         jToggleButtonConnect.setSelected(false);
         jMenuItemServerConnect.setEnabled(true);
         jMenuItemServerDisconnect.setEnabled(false);
         displayMessage(
             "Connection attempt failed: " + ex1.getMessage() + "\n", offlineClientAttrSet);
       }
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   else {
     disconnect();
     jMenuItemServerConnect.setEnabled(true);
     jMenuItemServerDisconnect.setEnabled(false);
     displayMessage("Disconnected\n", offlineClientAttrSet);
   }
 }
Exemplo n.º 3
0
 void jMenuItemClearMessages_actionPerformed(ActionEvent e) {
   jTextPaneDisplayMessages.setText("");
 }