public static void addComponentsToPane(Container pane) {

        if (!(pane.getLayout() instanceof BorderLayout)) {
            pane.add(new JLabel("Container doesn't use BorderLayout!"));
            return;
        }

        JPanel p = new JPanel();
        caption = new JLabel("");
        caption.setFont(caption.getFont().deriveFont(Font.BOLD, 16));
        p.add(caption);
        pane.add(p, BorderLayout.PAGE_START);

        da = new DrawArea(null);
        pane.add(da, BorderLayout.CENTER);

        p = new JPanel();
        p.setLayout(new BorderLayout());
        logArea = new JTextArea("Atlikti veiksmai:\n");
        logArea.setFont(logArea.getFont().deriveFont(Font.PLAIN, 12));
        logArea.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(logArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scrollPane.setPreferredSize(new Dimension(300, 0));
        p.add(scrollPane, BorderLayout.CENTER);
        logAreaCheck = new JCheckBox("Registruoti atliktus veiksmus.", true);
        p.add(logAreaCheck, BorderLayout.PAGE_END);
        pane.add(p, BorderLayout.WEST);

        p = new JPanel();
        // this is needed because combo box selections are not displayed over the draw area sometimes
        p.setBorder(BorderFactory.createEmptyBorder(25, 0, 0, 0));

        step = new JButton("Vienas žingsnis");
        step.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                doStep = true;
            }
        });
        p.add(step);

        final JTextField interval = new JTextField("2", 3);

        cont = new JButton("Tęsti");
        cont.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                if (!doContinue) {
                    try {
                        float inter = Float.parseFloat(interval.getText());
                        SLEEP_BETWEEN_STEPS = (int)(inter*1000);
                        if (SLEEP_BETWEEN_STEPS < 0) {
                            throw new Exception("Step interval too small.");
                        }
                        doContinue = !doContinue;
                        ((JButton)ae.getSource()).setText("Stabdyti");
                        interval.setEnabled(false);
                        step.setEnabled(false);
                    }
                    catch (Exception ex) {
                        JOptionPane.showMessageDialog(frame, "Žingsnio intervalas turi būti didesnis arba lygus nuliui.", "Netinkamas žingsnio intervalas", JOptionPane.ERROR_MESSAGE);
                    }
                }
                else {
                    ((JButton)ae.getSource()).setText("Tęsti");
                    interval.setEnabled(true);
                    step.setEnabled(true);
                    doContinue = !doContinue;
                }
            }
        });
        p.add(cont);

        p.add(new JLabel("Žingsnis kas:"));
        p.add(interval);
        p.add(new JLabel("s."));

        final JTextField diskNumber = new JTextField("3", 3);
        String[] algoTypes = { "Rekursyviai", "Iteraityviai"};
        final JComboBox algoList = new JComboBox(algoTypes);

        JButton reset = new JButton("Iš naujo");
        reset.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                try {
                    diskCount = Integer.parseInt(diskNumber.getText());
                    if (diskCount < 0 || diskCount > 100) {
                        throw new Exception("Disk number too small.");
                    }

                    doReset = true;
                    currentSolutionType = algoList.getSelectedIndex();

                    doContinue = false;
                    cont.setText("Tęsti");
                    step.setEnabled(true);
                    cont.setEnabled(true);
                    interval.setEnabled(true);
                    done.setVisible(false);

                    logArea.setText("Atlikti veiksmai:\n");
                }
                catch (Exception ex) {
                    JOptionPane.showMessageDialog(frame, "Diskų skaičius turi būti tarp 0 ir 100.", "Netinkamas diskų skaičius", JOptionPane.ERROR_MESSAGE);
                }
            }
        });
        p.add(reset);

        p.add(algoList);

        p.add(new JLabel("Pradinis diskų skaičius:"));
        p.add(diskNumber);

        done = new JLabel("Išspręsta");
        done.setOpaque(true);
        done.setBackground(new Color(0,255,0));
        done.setVisible(false);
        done.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        p.add(done);
        pane.add(p, BorderLayout.PAGE_END);
    }