Results 1 to 6 of 6
Thread: Exit System
- 09-14-2009, 05:48 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 56
- Rep Power
- 0
-
hmm, how about print the message first, then exit the system?
- 09-14-2009, 06:23 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 56
- Rep Power
- 0
yes, sorry, that is what I want to do, to print a message and then exit the system
- 09-14-2009, 06:29 AM #4
Member
- Join Date
- Aug 2009
- Posts
- 56
- Rep Power
- 0
here is what I have done:
I don't what else to put in the exit method to exit completely.Java Code:public void select() { char action = readAction(); execute(action); action = readAction(); } private char readAction() { System.out.print("\tEnter action (A/X): "); return In.nextLine().toUpperCase().charAt(0);} private void execute(char action) { switch(action) {case 'A' : add(); break; case 'X' : exit(); break default: System.out.println("\t\tInvalid action");}} private void exit() { S.o.p("exiting the system"); }
- 09-14-2009, 06:30 AM #5
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
search for joptionpane
How to Make Dialogs (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
for popup message
if use console, command line, use system.out.println(exit_msg);
exit the program
System (Java 2 Platform SE 5.0)
System.exit(0);
- 09-14-2009, 08:27 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
Avoiding system.exit()
By swati.jyoti in forum New To JavaReplies: 5Last Post: 07-01-2009, 10:17 AM -
System.exit 0 or 1?
By antgaudi in forum New To JavaReplies: 3Last Post: 11-13-2008, 06:33 PM -
System.exit() in catch block.
By new_2_java in forum Advanced JavaReplies: 8Last Post: 06-24-2008, 03:45 PM -
system.exit(..)
By ramakanta.majhi in forum New To JavaReplies: 2Last Post: 06-14-2008, 01:28 AM -
help with System.exit (1) function call
By katie in forum Advanced JavaReplies: 2Last Post: 08-06-2007, 08:03 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks