예제 #1
0
 void propDialog_actionPerformed(ActionEvent evt) {
   String cmd = evt.getActionCommand();
   if (cmd.equals("Cancel") == false) {
     createContext(
         propDialog.getHost(),
         propDialog.getPort(),
         propDialog.getCommunityName(),
         propDialog.getSocketType());
     sendGetRequest();
   } else {
     System.exit(0);
   }
 }
예제 #2
0
  public void init() {
    try {
      createPropertyDialog();
      propDialog.setVisible(true);
      propDialog.toFront();

      /*
       */
      createContext(
          propDialog.getHost(),
          propDialog.getPort(),
          propDialog.getCommunityName(),
          propDialog.getSocketType());
      sendGetRequest();
    } catch (Exception exc) {
      exc.printStackTrace();
    }
  }
예제 #3
0
  private void createPropertyDialog() {
    propDialog = new propertyDialog(null);

    String host = util.getHost();
    String port = "" + util.getPort(SnmpContextBasisFace.DEFAULT_PORT);
    String socketType = util.getSocketType();
    String comm = util.getCommunity();

    if (host != null) {
      propDialog.setHost(host);
    }
    if (port != null) {
      propDialog.setPort(port);
    }
    if (comm != null) {
      propDialog.setCommunityName(comm);
    }
    if (socketType != null) {
      propDialog.setSocketType(socketType);
    }
    propDialog.addActionListener(this);
    propDialog.pack();
  }