コード例 #1
0
 public void mouseEvt(MouseEvent evt) {
   if (evt.isPopupTrigger()) {
     propDialog.setVisible(true);
     propDialog.toFront();
     evt.consume();
   }
 }
コード例 #2
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(toid.getText());
   } else {
     // System.exit(0);
   }
 }
コード例 #3
0
  public void init() {
    try {
      createPropertyDialog();
      jbInit();

      propDialog.setVisible(true);
      propDialog.toFront();

      createContext(
          propDialog.getHost(),
          propDialog.getPort(),
          propDialog.getCommunityName(),
          propDialog.getSocketType());
      sendGetRequest(toid.getText());
    } catch (Exception exc) {
      exc.printStackTrace();
      lmessage.setText("Exception: " + exc.getMessage());
      lmessage.setBackground(Color.red);
    }
  }
コード例 #4
0
  private void createPropertyDialog() {
    myFrame = getFrame(this);
    propDialog = new propertyDialog(myFrame);

    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();
  }