Java program for sliding puzzle