示例#1
0
  public void init() {
    String host = util.getHost();

    h = new JLabel(host + " up since: ");
    v = new JLabel(" unknown ");
    setLayout(new GridLayout(2, 1));
    add(h);
    add(v);
    try {
      context = new SnmpContext(host, port);
    } catch (java.io.IOException exc) {
      System.out.println("IOException " + exc.getMessage());
      System.exit(0);
    }
  }
示例#2
0
  public void init() {
    // get the host name
    String host = util.getHost();

    h = new JLabel("Host " + host + ", Interface " + intfIndex + " speed");
    try {
      context = new SnmpContext(host, port);
      context.setCommunity(community);

      setLayout(new GridLayout(2, 1));
      add(h);
      v = new JLabel(" unknown ");
      add(v);
    } catch (java.io.IOException exc) {
      System.out.println("IOException " + exc.getMessage());
      System.exit(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();
  }