Solved

Wait for data from window to be submitted

Posted on 2004-08-25
13
182 Views
Last Modified: 2010-03-31
Greetings

Please excuse, probably a basic question , but developing mainly in Delphi, this was not a hurdle.

Example
Ok , Frame (A) , with one Button. Click on button and ActionListener code creates new Object of Frame (B) and displays the new frame.

What would be nice, would be for the code in Frame (A) to wait for data submitted in Frame (B) before continuing.

Thus, I only want execution to continue in the the class that creates the object AFTER I got the data from the second Frame.

Any pointers will be appreciated.

Thanks in advance.  
0
Comment
Question by:Engwi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +2
13 Comments
 
LVL 6

Expert Comment

by:expertmb
ID: 11890783
make the second frame modal frame.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11890797
Make the second window a modal Dialog.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11890810
Frames cannot be modal...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:expertmb
ID: 11890867
>>Frames cannot be modal...
awt  Frame/ swing JFrame cannot be made modal.
true.

venabili
>>make the second frame modal frame.
intention was to tell him to use the modal property.
0
 
LVL 35

Accepted Solution

by:
girionis earned 20 total points
ID: 11890872
Either go with the modal solution as suggested above or customize the SwingWorker class and with the help of a GlassPane make the user wait 'till the processing finishes before he can proceed. Something similar to windows when the hourglass appears and the user can't do anything:

http://www.javaworld.com/javaworld/jw-06-2003/jw-0606-swingworker-p1.html
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11890876
expertmb,

Sure. Just your suggestion was a little incorect ;)
0
 
LVL 6

Expert Comment

by:expertmb
ID: 11890894
>>Please excuse, probably a basic question , but developing mainly in Delphi, this was not a hurdle.

venabili,
dont you think this question should be asked in Delphi TA.
0
 
LVL 6

Expert Comment

by:expertmb
ID: 11890900
>>Sure. Just your suggestion was a little incorect ;)
:-)
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11891001
>>dont you think this question should be asked in Delphi TA.
Why? The guy said that til now he had used mainly Delphi; now it seems like he uses Java. That is teh reason to ask basic questions in Java as per his words
Read the questions carefully please... the question is in the correct area :)
0
 

Author Comment

by:Engwi
ID: 11903348
Venabili ... thanks for being observant :-)

As to the question, I have my own little implementation using a thread that seems so work quite nicely, but as regards to a MODAL propery... I am still a little lost.. I can see this to be true for a JDialog in one of it's contructors though...

Please tell me what I am missing here.

Tanks in advance.


0
 
LVL 35

Expert Comment

by:girionis
ID: 11903812
Engwi take a look at the link I posted, it might be what you are looking for.
0
 
LVL 3

Expert Comment

by:CI-Ia0s
ID: 11922186
You could have the action listener method in Frame A create Frame B and display it, then stop. Then have a call to a method in Frame A with the rest of the code when the data is submitted in Frame B. In other words, just split the code that creates the second frame and the code after that into two methods and have the second frame call the second method in Frame A.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11929005
:)
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 105
Setup GlassFish 4 55
junit example issue 2 58
Find out all repos that a user is most active on Github 1 58
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question