Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Question Making a game restart? :/

    Hi.
    I've made a little game in a JFrame, and when you complete the game it comes up a button saying "Restart". Currently, if i press that button it creates a new JFrame with the game on it, but how do i do so that the program simply restarts?

    /Thanks

  2. #2
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Anyone? :/

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,051
    Blog Entries
    7
    Rep Power
    23

    Default

    Quote Originally Posted by AndroidAppNewbie View Post
    Anyone? :/
    You have to find a point in your code that restarts the game given an already existing JFrame etc. The ActionListener of your button should call that point/method. If you can't find such point in your code you have to refactor your code.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Making hangman game
    By Snow_Fox in forum New To Java
    Replies: 0
    Last Post: 11-29-2010, 10:42 PM
  2. Replies: 5
    Last Post: 09-26-2010, 03:44 PM
  3. Game making help
    By Mrkantaloupe in forum New To Java
    Replies: 2
    Last Post: 07-13-2010, 10:15 PM
  4. need help making a game board
    By Don k in forum New To Java
    Replies: 2
    Last Post: 04-30-2010, 12:09 AM
  5. need help with a simple game im making
    By frallan in forum AWT / Swing
    Replies: 2
    Last Post: 11-30-2009, 11:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •