SnmpGetTableUI_one.java.txt
上传用户:aonuowh
上传日期:2021-05-23
资源大小:35390k
文件大小:1k
- /* $Id: SnmpGetTableUI_one.java,v 1.2 2002/06/18 07:18:13 kousalya Exp $ */
- /* SnmpGetTableUI_one.java
- * Copyright (c) 1996-2003 AdventNet, Inc. All Rights Reserved.
- * Please read the associated COPYRIGHTS file for more details.
- */
- import javax.swing. *;
- import java.awt.event. *;
- import com.adventnet.snmp.ui. *;
- public class SnmpGetTableUI_one {
- TableBean tablebean = new TableBean ();
- JScrollPane scrollpane = new JScrollPane(tablebean);
-
- public static void main (String args[]) {
-
- SnmpGetTableUI_one gettable = new SnmpGetTableUI_one();
- JFrame frame = new JFrame ();
- frame.setVisible (true);
- frame.addWindowListener (new WindowAdapter ()
- {
- public void windowClosing (WindowEvent evt)
- {
- System.exit (0);
- }
- }
- );
- frame.setSize (615, 400);
- frame.setTitle (" Tutorial Example for retreiving SNMP Table using TableBean");
- frame.getContentPane ().setLayout (null);
-
- frame.getContentPane().add(gettable.scrollpane);
-
- gettable.scrollpane.setBounds (30, 80, 490, 120);
- gettable.tablebean.setTargetHost("localhost");
- gettable.tablebean.setCommunity("public");
- try {
- gettable.tablebean.setMibModules("RFC1213-MIB");
- gettable.tablebean.setTableOID ("tcpConnTable");
- } catch (Exception ex) {
- System.err.println("Error: "+ex);
- }
- frame.show();
- }
- }