Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-03-2011, 07:23 AM   #1
LQ Newbie
Registered: Sep 2010
Location: INDIA
Posts: 15

Rep: Reputation: 0
Unhappy Restart the Program execution : Java

In gui validation if user enters string in integer requiring field, a dialog box pops out. So on clicking the button i want to stop the program execution and return to the previous jframe(either the same one or newly created object of it).

How can i handle this in java.
I tried calling main(); but it doesn't work.
Also System.exit(0); doensn't work.

Thanx in advance!!
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-04-2011, 02:23 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
If you want to validate input using a GUI, then you need to:

a) decide at which point validation should occur (for example, when the user pushes the "accept" button)
b) write an event handler for whichever GUI object gets the event (for example, the "accept" Jbutton)

Here's a good link about event handling in Java Swing:
2 members found this post helpful.


execution, java

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restart PADS from Java Program khirodpatra Linux - Newbie 1 07-15-2010 02:08 AM
create bin file for execution of java program jigargajjar Linux - Software 1 12-03-2009 04:39 AM
java program compilation n execution :me a newbie narendra.pant Programming 2 04-15-2006 02:23 PM
Pausing the execution of a java program with linux balteo Linux - Software 2 09-04-2005 11:47 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 10:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration