473,394 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

JFrame execution from a console Java application

I'm relatively new to Java Swing programming. I have a console application
that processes text files and while doing so I want to suspend the execution
when an error is encountered that requires the user to make a choice. I want
to do that with my own JFrame that allows the user to edit the bad data in a
GUI and then click "Accept" or "Ignore". If the user clicks "Accept", the
JFrame contributes the data to the standard output being generated by the
console application; otherwise it just leaves it out.

My problem is that when I create the JFrame from my console application and
call the frame's show() method, program execution does not block. I want the
program to stop until the user closes the JFrame.

Is this possible, and if so, how?

-tuno
Jul 17 '05 #1
1 3303
On Thu, 24 Jun 2004 16:49:21 +0000, Tuno wrote:
I'm relatively new to Java Swing programming. I have a console application
that processes text files and while doing so I want to suspend the execution
when an error is encountered that requires the user to make a choice. I want
to do that with my own JFrame that allows the user to edit the bad data in a
GUI and then click "Accept" or "Ignore". If the user clicks "Accept", the
JFrame contributes the data to the standard output being generated by the
console application; otherwise it just leaves it out.

My problem is that when I create the JFrame from my console application and
call the frame's show() method, program execution does not block. I want the
program to stop until the user closes the JFrame.

Is this possible, and if so, how?

-tuno


You may want a modal dialog (javax.swing.JDialog). But you might really
want to use System.in to get the user's response, and System.out to
display it, instead, so that the console application remains a console
application. GUIs don't work terribly well over remote shells, etc., and
they're not nearly as easily-scriptable.

--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fereshteh Shojaei | last post by:
Hi, I wonder if somebody could help me. I would like to move the cursor from one JTextField to another one when I press <CR>. Regards, Fereshteh
3
by: Ranjan Sinha | last post by:
Hi, I want to create a toolbar that is floating by default and is not dockable. I understand that for this I have to override the default BasicToolBarUI. For this I wrote the following code....
3
by: omission9 | last post by:
Any advice on the following would be much appreciated. I have thrown everything I have at it and am completely stumped. I apologize for the length, I have tried to be as succint as possible. I...
7
by: sreenulanka | last post by:
please help me in my forum i have labels and textareas .iwant to add textarea components dyanamically when i am clicking the button.please help me import java.awt.*; import javax.swing.*;...
10
by: dishal | last post by:
Hi, im having a major problem with printing text on a JFrame. This is a simple whiteboard I'm doing but i just cannot seem to print the text properly. It prints all the alphabets on the same point...
3
by: coffeetime | last post by:
Hi, I just decided to learn java, so I'm quite a noob. I use the book learning java third edition. have JDK 1.6 program in notepad. I have made the simple HelloJava example, and now i wanted to...
3
by: coffeetime | last post by:
Hi, I just decided to learn java, so I'm quite a noob. I use the book learning java third edition. have JDK 1.6 program in notepad. I have made the simple HelloJava example, and now i wanted to...
2
by: zahit | last post by:
hi guys, my line doesn't appear on the frame. what's the problem? import java.util.*; import java.io.*; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.*; public class...
3
by: notaCons | last post by:
hello im quite newbies in Java Programing so any one can help me. i will be plz.... what am i trying here is try convert The JFrame to JApplet, but when i change the JFrame to JApplet 4 Error come...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.