how to use java to write a simple puzzle?

???
Hi, there
I am new to Java, and I found some good puzzles around web sites. I want to know how these can be done by Java, could some one give me some ideas or give me some Java codes examples.

Thanks!

simple point and click puzzles like those shifting square puzzles could be done very easily with swing, just make a panel with some picture icon onit, and add a mouseListener to shift it to the empty spot on the board if it’s next to it. or if you’re really lazy, use buttons with icons and no border.

the best way to learn is to open up JCreator (or whatever you use) and think what you might need to do, throw up some code to see if it’s possible, and then do it.