Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Wait for data from window to be submitted

Posted on 2004-08-25
13
Medium Priority
?
188 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 80 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

971 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