SnmpGetTableUI.java.txt
上传用户:aonuowh
上传日期:2021-05-23
资源大小:35390k
文件大小:1k
- /* $Id: SnmpGetTableUI.java,v 1.1 2002/06/15 14:40:08 ram Exp $ */
- /* SnmpGetTableUI.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 {
- public static void main (String args[]) {
-
-
- JFrame frame = new JFrame ();
- 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 SnmpTableModel bean ");
-
-
- SnmpTableModel datatable = new SnmpTableModel ();
- datatable.setTargetHost("localhost");
- datatable.setCommunity("public");
- try {
- datatable.loadMibs("RFC1213-MIB");
- datatable.setTableOID ("tcpConnTable");
- } catch (Exception ex) {
- System.err.println("Error: "+ex);
- }
-
- JTable table = new JTable(datatable);
- JScrollPane scrollpane = new JScrollPane(table);
- frame.getContentPane().add(scrollpane);
- frame.setVisible(true);
-
- }
-
- }