コード例 #1
0
 public void discoveryInfoResult(JID jid, DiscoveryInfo item) {
   // DefaultListModel model = (DefaultListModel) jList1.getModel();
   numberOfServices--;
   System.out.println(numberOfServices);
   if (numberOfServices <= 0) setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   DefaultListModel model = (DefaultListModel) jList1.getModel();
   String name = item.getName();
   if (name != null && model.removeElement(jid.toStringNoResource())) {
     model.addElement(name);
   }
   if (item.hasFeatures()) {
     for (Iterator j = item.getFeatures(); j.hasNext(); ) {
       String namespace = (String) j.next();
       if (namespace.equals("jabber:iq:register")) {
         if (name != null) services.put(item.getName(), jid);
         else services.put(jid.toStringNoResource(), jid);
       }
       // else{} remove from services
     }
   }
 }
コード例 #2
0
 void btnChangeServer_actionPerformed(ActionEvent e) {
   setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   JID temp = null;
   try {
     temp = JID.checkedJIDFromString(txtServer.getText());
   } catch (InstantiationException ex) {
     nu.fw.jeti.util.Popups.errorPopup(ex.getMessage(), I18N.gettext("main.error.invalid_server"));
   }
   if (temp == null) return;
   server = temp;
   backend.getItems(server, this);
 }