private void createControlPanel(){
        controlPanel = new JPanel();

        final JButton startButton = new JButton("start");
        final JButton stopButton = new JButton("stop");
        stopButton.setEnabled(false);
        final JButton pauseButton = new JButton("pause");
        pauseButton.setEnabled(false);
        final JButton settingsButton = new JButton("settings");

        startButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(config.getMainTag().equals("")){
                    showError("Main tag not defined");
                    return;
                }
                if(config.getAccessToken().equals("")){
                    showError("Access token ton defined");
                    return;
                }
                File f = new File(config.getIrfanViewPath());
                if(!f.exists()){
                    showError("IrfanView not found");
                    return;
                }

                startButton.setEnabled(false);
                settingsButton.setEnabled(false);
                //Config config = new Config();
                long time = (new Date().getTime())/ 1000 - 20*60;
                System.out.println("start time:" + time);
                controller = new Controller(config, new IrfanViewPrinter(config.getIrfanViewPath()), TIMEOUT, time, ic);
                controller.start();
                stopButton.setEnabled(true);
            }
        });

        stopButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                stopButton.setEnabled(false);
                controller.stop();
                controller = null;
                startButton.setEnabled(true);
                settingsButton.setEnabled(true);
            }
        });

        settingsButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                ConfigDialog dialog = new ConfigDialog(frame, config);

                dialog.create();
            }
        });

        controlPanel.add(settingsButton);
        controlPanel.add(startButton);
        controlPanel.add(pauseButton);
        controlPanel.add(stopButton);
    }