Esempio n. 1
0
 private void addChannel() {
   try {
     final String name = addChannelNameTextField.getText();
     final String description = addChannelDescTextField.getText();
     final String url = addChannelUrlTextField.getText();
     final double activeRadius = Double.parseDouble(addChannelRadiusTextField.getText());
     final JSONObject addChannelResult =
         Geo2TagService.addChannel(authToken, name, description, url, activeRadius);
     if (addChannelResult
         .optString(Geo2TagConstants.Params.STATUS)
         .equals(Geo2TagConstants.LOGIN_STATUS_OK)) {
       showChannels();
       channelsStatusBarLabel.setText("");
     } else {
       channelsStatusBarLabel.setText(
           addChannelResult.optString(Geo2TagConstants.Params.STATUS_DESCRIPTION));
     }
   } catch (final Exception e) {
     channelsStatusBarLabel.setText("Error: " + e.getMessage());
     System.out.println("Error: " + e);
     e.printStackTrace();
   }
 }