@Override
    public void startEvent(){
        graph.resetGraph();
        try{
            //--INITIALIZING
            height = 0; time = 0; 
            displacementX = 0;   displacementY = 0;

            initialVelocity = Double.parseDouble(inputVelocityProjectile.getText());
            initialAngle = Double.parseDouble(inputAngleProjectile.getText());

            if(!inputHeightProjectile.getText().isEmpty()){
                height = Double.parseDouble(inputHeightProjectile.getText());
                if(height < 0 || height > 100){
                    throw new ArithmeticException();
                }
            }

            if( initialAngle > 90 ||  initialAngle < 0 || initialVelocity <= 0 || initialVelocity > 50){ 
                throw new ArithmeticException();
            }

            initialVX = initialVelocity*Math.cos(Math.toRadians(initialAngle));  
            initialVY = initialVelocity*Math.sin(Math.toRadians(initialAngle));
            timeToTop = Double.parseDouble(df_2.format(initialVY/ACCELERATION));

            maxDisplacementY = height+ initialVY*timeToTop - (0.5)*ACCELERATION*Math.pow(timeToTop,2);
            heightTime =  Double.parseDouble(df_2.format(Math.sqrt(maxDisplacementY/(0.5*ACCELERATION)) - timeToTop));
            startButtonProjectile.setDisable(true);
            projectileAnimationTimeline.play();
        }catch(ArithmeticException a){
            JOptionPane.showMessageDialog(null, "Please enter a correct value for each box.");
        }catch(Exception o){
            JOptionPane.showMessageDialog(null, "Please enter a value for the initial velocity and the angle");
        }        
    }