Search in sources :

Example 1 with ZooInspectorManagerImpl

use of org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl in project zookeeper by apache.

the class ZooInspector method main.

/**
     * @param args
     *            - not used. The value of these parameters will have no effect
     *            on the application
     */
public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JFrame frame = new JFrame("ZooInspector");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        iconResource = new IconResource();
        final ZooInspectorPanel zooInspectorPanel = new ZooInspectorPanel(new ZooInspectorManagerImpl(), iconResource);
        frame.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosed(WindowEvent e) {
                super.windowClosed(e);
                zooInspectorPanel.disconnect(true);
            }
        });
        frame.setContentPane(zooInspectorPanel);
        frame.setSize(1024, 768);
        frame.setVisible(true);
    } catch (Exception e) {
        LoggerFactory.getLogger().error("Error occurred loading ZooInspector", e);
        JOptionPane.showMessageDialog(null, "ZooInspector failed to start: " + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
    }
}
Also used : ZooInspectorManagerImpl(org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl) JFrame(javax.swing.JFrame) WindowEvent(java.awt.event.WindowEvent) IconResource(org.apache.zookeeper.inspector.gui.IconResource) WindowAdapter(java.awt.event.WindowAdapter) ZooInspectorPanel(org.apache.zookeeper.inspector.gui.ZooInspectorPanel)

Aggregations

WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 JFrame (javax.swing.JFrame)1 IconResource (org.apache.zookeeper.inspector.gui.IconResource)1 ZooInspectorPanel (org.apache.zookeeper.inspector.gui.ZooInspectorPanel)1 ZooInspectorManagerImpl (org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl)1