Results 1 to 10 of 10
- 09-16-2012, 04:20 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
- 09-16-2012, 04:24 PM #2
Re: java app
By "closing" are you talking about a window closing?
If you don't want the program to exit to the OS, don't call the System.exit() method until the user closes the window.If you don't understand my response, don't ignore it, ask a question.
- 09-16-2012, 04:28 PM #3
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Re: java app
i never used that method.What i wanna do is when my program finishes with its work to stop, not to close, because i never get to see my final result?
- 09-16-2012, 04:37 PM #4
Re: java app
Does the program display its results on the console
or in a GUI window?
What do you mean by "close"? What happens when you execute the program? What happens when the program finishes?If you don't understand my response, don't ignore it, ask a question.
- 09-16-2012, 04:41 PM #5
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Re: java app
Its console. It exits the OS like you said it, but I want program to stop and me to close it with the x button on the top when i decite to
-
Re: java app
This is more of an OS issue than a Java issue. If you're running on Windows, you could create a command window by calling cmd.exe, then calling your program from the command window. Then the window will stay open until you type in exit.
- 09-16-2012, 04:56 PM #7
Re: java app
Another option would be to use the Scanner class. It could try to read from the console with a next method that would block execution of the program until the user entered something.
If you don't understand my response, don't ignore it, ask a question.
- 09-16-2012, 05:09 PM #8
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Re: java app
thanks, its a great idea :)
- 09-16-2012, 05:18 PM #9
Re: java app
Btdt
If you don't understand my response, don't ignore it, ask a question.
- 09-16-2012, 06:56 PM #10
Re: java app
nhrnjic6, please go through the Forum Rules -- particularly the third paragraph.
dbWhy do they call it rush hour when nothing moves? - Robin Williams


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks