private void changeLayersCount(){
        if (!_layersCount.getText().equals("")){
            long layersCount = new Long(_layersCount.getText());
            System.out.println(layersCount);

            if (layersCount > _myFrames.size()){
                //_scrollPane.setVisible(false);
                int height = 1 + (_myFrames.size()) * 30;
                MyFrame myFrame;
                for (long i = _myFrames.size() ; i < layersCount ; i++){
                    myFrame = new MyFrame(i,height);
                    myFrame.setBounds(1, height, 320, 30);
                    _scrollPane.add(myFrame);
                    _myFrames.add(myFrame);
                    height += 30;
                }
            } else {
                System.out.println("asd");
                System.out.println(_myFrames.size());
                for (int i = _myFrames.size() - 1; i >= layersCount ; i--){
                    _myFrames.get(i).setVisible(false);
                    _myFrames.remove(i);
                }
            }
            frame.validate();

        }
    }