Пример #1
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);
 }
Пример #2
0
 public void discoveryItemResult(JID jid, DiscoveryItem item) {
   // System.out.println(browse);
   if (!item.hasItems())
     nu.fw.jeti.util.Popups.errorPopup(
         I18N.gettext("main.error.No_services"), I18N.gettext("main.error.Register_Services"));
   else {
     numberOfServices = 0;
     DefaultListModel model = (DefaultListModel) jList1.getModel();
     services.clear();
     model.clear();
     for (Iterator i = item.getItems(); i.hasNext(); ) {
       DiscoveryItem di = (DiscoveryItem) i.next();
       String name = di.getName();
       if (name == null) name = di.getJID().toStringNoResource();
       // put in services so errors do not prevent register
       services.put(name, di.getJID());
       model.addElement(name);
       backend.getInfo(di.getJID(), this);
       numberOfServices++;
     }
   }
   pack();
   setLocationRelativeTo(null);
 }