@Override
    public void actionPerformed(ActionEvent ae)
    {
        if (ae.getSource() == okay)
            {
                tick = (int)((double)1000/speedSlider.getValue());
                System.out.println("ms per frame " + tick);
                userOkay = true;
                setVisible(false);
            }
        else if (ae.getSource() == cancel)
            {
                setVisible(false);
            }
    }