stop command (I need help)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaft
    New Member
    • Nov 2006
    • 6

    #1

    stop command (I need help)

    Hi every body

    I am new in the forum and in JAVA language. I have a program in Java and I need to add a statement that stop runing the program without exiting the form or the window. please help me.

    regards
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by shaft
    Hi every body

    I am new in the forum and in JAVA language. I have a program in Java and I need to add a statement that stop runing the program without exiting the form or the window. please help me.

    regards
    Post your code (using code tags) and explain when you want the program to stop.

    Comment

    • horace1
      Recognized Expert Top Contributor
      • Nov 2006
      • 1510

      #3
      you can delay for a peroid of time, e.g.
      (1) The method sleep() is defined in the class Thread, sleep(1000) puts thread aside for exactly one second.
      (2) The method wait() is defined in the class Object, wait(1000) causes a wait of up to one second; a thread could stop waiting earlier if it receives the notify() or notifyAll() call.

      or you could use a 'forever' loop
      while(true);

      you would then have to kill the process

      Comment

      • baskarpr
        New Member
        • Oct 2006
        • 33

        #4
        If your problem is exiting the progrm
        I think you can use System.exit(0);

        Comment

        • froggers
          New Member
          • Nov 2006
          • 3

          #5
          yeah but he doesn't want the window to close, he just wants to stop all processes

          Comment

          Working...