Solved

Wait for data from window to be submitted

Posted on 2004-08-25
13
179 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java DateChooser? 3 36
Spring Framework HTTPSession management 1 36
ForLoop Example 3 49
web services creation SOAP vs REST 5 42
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

822 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