Move slider into Java as it runs smoother.