Results 1 to 2 of 2
  1. #1
    rajkobie is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default How do I stop the program but not exit the JFrame?

    I am making a game in Java and my GUI is JFrame. I use the paintComponent ( Graphics g ) method to draw and I use the ActionListener to do sprite movement etc.

    If i lose or win the game, i show a different background suitable for the condition. I want the game to stop after this. I used debugger and it shows the my program runs every after i show to background. Is there a method i can call to stop the execution and just show that background until user exits?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 4
    Last Post: 07-29-2010, 03:53 PM
  2. Could not find main class: Jframe. Program will exit.
    By egbert95 in forum Advanced Java
    Replies: 8
    Last Post: 07-29-2010, 03:53 PM
  3. Use stop button to stop moving (stop timers) on JPanel
    By mneskovic in forum New To Java
    Replies: 3
    Last Post: 07-23-2010, 01:50 PM
  4. how to stop/exit the mediabox JAVAFX
    By xclaim in forum New To Java
    Replies: 2
    Last Post: 11-26-2009, 03:33 AM
  5. How to exit the program by typing "exit"?
    By Laythe in forum New To Java
    Replies: 6
    Last Post: 08-19-2009, 09:32 PM

Posting Permissions

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