protected void addSpinnerListeners(){
        final JFormattedTextField textField = getTextField( spinner );
        final int minValue = this.min;
        final int maxValue = this.max;
        textField.addKeyListener( new KeyAdapter() {
            @Override
            public void keyReleased( final KeyEvent e ) {
                if ( e.getKeyCode() == KeyEvent.VK_ENTER ) {
                    String input = textField.getText();

                    try{

                        Integer intInput = Integer.parseInt(input);

                        if(intInput > maxValue || intInput < minValue){
                            showWarning();
                            textField.setValue(slider.getValue());
                        }
                        else{
                            if(canChange(intInput)) {
                                slider.setValue(intInput);
                                changed();
                            }
                            else {
                                textField.setValue(slider.getValue());
                            }
                        }
                    }catch (NumberFormatException ex){
                        showWarning();
                        textField.setValue(slider.getValue());
                    }
                }
            }
        } );


        spinner.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSpinner spinner = (JSpinner)(e.getSource());
                SpinnerNumberModel model = (SpinnerNumberModel)(spinner.getModel());
                int value = model.getNumber().intValue();
                if(canChange(value)){
                    slider.setValue(value);
                    changed();
                }
                else {
                    spinner.setValue(slider.getValue());
                }
            }

        });

    }