Thursday, January 14, 2010

Shuffle Game In Java


Shuffle Game


You need to arrange the tiles with respect to their numbers from 1 to 15. Empty space should be at last place. Use the “New Game” start a fresh game anytime. “Refresh Game” will help you to reset the board to the initial status of the present game.

Java Source Code for shuffle Game:

Following are the classes used to develop this game.

  • Main
  • GameFrame
  • OptionsPanel
  • TilesPanel
  • TileNumber
  • RandomNumber
  • ArrowKeyAction

Download Java Files

Need the game directly !!!  Download Game

Please report bugs, if any :D and needed enhancements through comments.

Detailed description of code will be updated ASAP.


  1. Can you please explain how to create your own user defined action listeners for reusable controls? for example, the login control? Thanks in advance...

  2. @ Kavya

    I'll post the topic with sample code ASAP.....

  3. I faced this problem .Hoping for the output and the way to program this.

    " Create a HTML page which contains a form in it which uses POST method and it s ho uld be submitted to a page named "ReferAFriend.jsp". The form should contain the following.:

    - text box to accept name of referrer(compulsory field)
    - text box to accept email address of referrer(compulsory field)
    - a table with five rows, each accepting the name and email address of person being referred(at least one of the rows should be filled)
    - a person message from the referrer that will be sent to all the people being referred(optional)

    When the submit button gets clicked, validate the entries. specifically, if a row has entries, both the name of the referrer and the email address must be present, and the email address must be valid email address(should have alphanumerals followed by an "@" followed by a "." followed by alphabets). If any errors are found, prevent the form from getting submitted and display the appropriate error message. You need to write client-side javascript for this.

    If no errors are found, the "ReferAFriend.jsp" page would accept the data and stgore it in a text file on the server(decide an appropriate file naming convention.) The page would then inform the user that their referral has been successful and that mails have been sent out.(You do not need to write the code for sending out the referral emails)

  4. 2) Create a JSP page named "SortMyList.jsp" which has the form which contains :
    - ten text boxes
    - a drop down that includes the following three operationsL
    a) SortAscending
    b) SortDescending
    c) RevertToOriginalList
    - A submit button to submit the form

    The user can input between 1 to 10 integers in these text boxes. The form uses POST method and the form data should get submitted to the same JSP page itself

    when form gets submitted, the program needs to arrange these numbers( in the text boxes on the jsp page) based on what the user has chosen for the operation from the dropdown :

    - if SortAscending is chosen, the list of numbers will be displayed in Ascending order
    - if SortDescending is chosen, the list of numbers will be displayed in Descending order
    - if RevertToOriginalList is chosen, the list of numbers will be displayed as entered by the user at the start

    You need not write any client-side javascript code since problem demands server side scripting.

  5. There are many methods to make money online and by performing a simple search, you can find out what these methods are and easily get started on some of them.
    minecraft server hosting