Solved

Wait for data from window to be submitted

Posted on 2004-08-25
13
175 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now