resetResults.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { results.setText(""); insertResults("Welcome!"); } });
    public Sidebar(AutWindow _autWin) {        super();                JSplitPane splitter;        JScrollPane listScroller, resultScroller;        JPanel upperPanel, buttonPanel, lowerPanel;                autWin = _autWin;                upperPanel = new JPanel(new BorderLayout());                newAut = new JButton(new ImageIcon("src/images/stock_new.png"));        renAut = new JButton(new ImageIcon("src/images/stock_edit.png"));        delAut = new JButton(new ImageIcon("src/images/stock_cancel.png"));                newAut.setToolTipText(java.util.ResourceBundle.getBundle("global").getString("insAut"));        renAut.setToolTipText(java.util.ResourceBundle.getBundle("global").getString("renAut"));        delAut.setToolTipText(java.util.ResourceBundle.getBundle("global").getString("remAut"));                autList = new JList();        autList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        listModel = new DefaultListModel();        autList.setModel(listModel);        lastSel = -1;        listData = new LinkedList<FSA>();                listScroller = new JScrollPane(autList);                upperPanel.add(listScroller, BorderLayout.CENTER);                buttonPanel = new JPanel();                buttonPanel.add(newAut);        buttonPanel.add(renAut);        buttonPanel.add(delAut);                // initial ist nur ein Automat in der Liste, dieser kann nicht gelscht werden        delAut.setEnabled(false);                upperPanel.add(buttonPanel, BorderLayout.SOUTH);                results = new JTextArea();        results.setEditable(false);        resultScroller = new JScrollPane(results);                lowerPanel = new JPanel(new BorderLayout());                lowerPanel.add(resultScroller, BorderLayout.CENTER);        lowerPanel.add(new JButton(java.util.ResourceBundle.getBundle("global").getString("resetOut")), BorderLayout.SOUTH);                splitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upperPanel, lowerPanel);        splitter.setResizeWeight(0.55);                this.setLayout(new BorderLayout());        this.add(splitter, BorderLayout.CENTER);                // entfernen den gewhlten Automaten        delAut.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                int lastSelCopy = lastSel;                if (lastSelCopy!=-1) {                    lastSel = -1;                    listData.remove(lastSelCopy);                    listModel.removeElementAt(lastSelCopy);                    autList.setSelectedIndex(listModel.getSize()-1);                    if (listModel.getSize()<=1)                        delAut.setEnabled(false);                }            }        });                // zeigt ein Dialogfenster mit dem der Automatenname gendert werden kann        renAut.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                String newName;                                if (lastSel!=-1) {                    newName = JOptionPane.showInputDialog(autWin, java.util.ResourceBundle.getBundle("global").getString("newName"),                            listModel.elementAt(lastSel));                    if (newName==null) return; // cancel gedrckt                    newName = newName.trim();                    for (int i = 0 ; i <  newName.length()  ; i++ ) {                        if (!Character.isJavaIdentifierPart(newName.charAt(i))) {                            JOptionPane.showMessageDialog(autWin,                                    java.util.ResourceBundle.getBundle("global").getString("InvalidName"),                                    java.util.ResourceBundle.getBundle("global").getString("Error"), JOptionPane.ERROR_MESSAGE);                            return;                        }                    }                    listModel.setElementAt(newName, lastSel);                    autWin.setCurrentName(newName);                }            }        });                        // fge einen neuen Automaten in die Liste ein, bis zur Obergrenze        newAut.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                if (listModel.getSize()<MAX_AUT) {                    insertNewAut();                } else {                    newAut.setEnabled(false);                }            }        });                        autList.addListSelectionListener(new ListSelectionListener() {            public void valueChanged(ListSelectionEvent ev) {                int selection = autList.getSelectedIndex();                if (selection!=lastSel) {                    if (lastSel!=-1) {                        listData.set(lastSel, autWin.toFSA());                    }                    lastSel = selection;                    autWin.insertAut(listData.get(selection));                }            }        });    }