private void addButtons() {
            play = new JButton("Play");
            play.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (dt == 0) {
                        dt = CustomOptionMenu.doubleInput("Enter dt.");
                    }
                    if (dt != 0) {
                        try {
                            thread.start();
                        } catch (Exception ex) {
                        }
                        paused = false;
                    }
                    mainPanel.requestFocus();
                }
            });
            add(play);

            play60 = new JButton("Play at 60FPS");
            play60.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    dt = 1.0 / 60.0;
                    play.doClick();
                }
            });
            add(play60);

            pause = new JButton("Pause");
            pause.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    paused = true;
                    mainPanel.requestFocus();
                }
            });
            add(pause);

            update = new JButton("Update");
            update.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (dt == 0) {
                        dt = CustomOptionMenu.doubleInput("Enter dt.");
                    }
                    mainPanel.world.update(dt);
                    updateLabels();
                    if (!playing) {
                        mainPanel.repaint();
                    }
                    mainPanel.requestFocus();
                }
            });
            add(update);

            save = new JButton("Save");
            save.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    makeBackup();
                    saved = true;
                    mainPanel.requestFocus();
                }
            });
            add(save);

            reset = new JButton("Reset");
            reset.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (saved) {
                        for (int i = 0; i < mainPanel.world.clickFrameList.size(); i++) {
                            ClickFrame clickFrame = mainPanel.world.clickFrameList.get(i);
                            mainPanel.world.clickFrameList.remove(clickFrame);
                            clickFrame.dispose();
                        }
                        boolean temp1 = mainPanel.world.follow;
                        int temp2 = mainPanel.world.followID;
                        mainPanel.world = copyWorld(backupWorld);
                        mainPanel.world.follow = temp1;
                        mainPanel.world.followID = temp2;
                        if (!playing) {
                            mainPanel.repaint();
                        }
                        mainPanel.requestFocus();
                    }
                }
            });
            add(reset);

            add(dtLabel);

            clearArrows = new JButton("Clear arrows");
            clearArrows.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    mainPanel.world.impulses.clear();
                    mainPanel.world.normals.clear();
                    if (!playing) {
                        mainPanel.repaint();
                    }
                    mainPanel.requestFocus();
                }
            });
            add(clearArrows);

            setDt = new JButton("Set dt");
            setDt.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    dt = CustomOptionMenu.doubleInput("Enter dt.");
                }
            });
            add(setDt);
        }