public HelmaDebugger(String name) { super(name); Container contentPane = getContentPane(); Component main = contentPane.getComponent(1); contentPane.remove(main);  treeRoot = new DebuggerTreeNode(name); tree = new JTree(treeRoot); treeModel = new DefaultTreeModel(treeRoot); tree.setModel(treeModel); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addTreeSelectionListener(this);   tree.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { openScript(tree.getSelectionPath()); } });  tree.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER) openScript(tree.getSelectionPath()); } }); JScrollPane treeScroller = new JScrollPane(tree); treeScroller.setPreferredSize(new Dimension(180, 300));  list = new JList();  list.setFont(list.getFont().deriveFont(Font.PLAIN)); list.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { openFunction((String) list.getSelectedValue()); } }); list.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER) openFunction((String) list.getSelectedValue()); } }); JScrollPane listScroller = new JScrollPane(list); listScroller.setPreferredSize(new Dimension(180, 200));  JSplitPane split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT); split1.setTopComponent(treeScroller); split1.setBottomComponent(listScroller); split1.setOneTouchExpandable(true); Main.setResizeWeight(split1, 0.66);  JSplitPane split2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split2.setLeftComponent(split1); split2.setRightComponent(main); split2.setOneTouchExpandable(true); contentPane.add(split2, BorderLayout.CENTER);
public HelmaDebugger(String title) { gui = new DebugGui(this, title); gui.pack(); gui.setVisible(true);
    public HelmaDebugger(String name) {        super(name);        Container contentPane = getContentPane();        Component main = contentPane.getComponent(1);        contentPane.remove(main);        treeRoot = new DebuggerTreeNode(name);        tree = new JTree(treeRoot);        treeModel = new DefaultTreeModel(treeRoot);        tree.setModel(treeModel);        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);        tree.addTreeSelectionListener(this);        // tree.setRootVisible(false);        // track double clicks        tree.addMouseListener(new MouseAdapter() {            public void mouseClicked(MouseEvent evt) {                openScript(tree.getSelectionPath());            }        });        // track enter key        tree.addKeyListener(new KeyAdapter() {            public void keyPressed(KeyEvent evt) {                if (evt.getKeyCode() == KeyEvent.VK_ENTER)                    openScript(tree.getSelectionPath());            }        });        JScrollPane treeScroller = new JScrollPane(tree);        treeScroller.setPreferredSize(new Dimension(180, 300));        list = new JList();        // no bold font lists for me, thanks        list.setFont(list.getFont().deriveFont(Font.PLAIN));        list.addMouseListener(new MouseAdapter() {            public void mouseClicked(MouseEvent evt) {                openFunction((String) list.getSelectedValue());            }        });        list.addKeyListener(new KeyAdapter() {            public void keyPressed(KeyEvent evt) {                if (evt.getKeyCode() == KeyEvent.VK_ENTER)                    openFunction((String) list.getSelectedValue());            }        });        JScrollPane listScroller = new JScrollPane(list);        listScroller.setPreferredSize(new Dimension(180, 200));        JSplitPane split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);        split1.setTopComponent(treeScroller);        split1.setBottomComponent(listScroller);        split1.setOneTouchExpandable(true);        Main.setResizeWeight(split1, 0.66);        JSplitPane split2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);        split2.setLeftComponent(split1);        split2.setRightComponent(main);        split2.setOneTouchExpandable(true);        contentPane.add(split2, BorderLayout.CENTER);    }