Solved

Wait for data from window to be submitted

Posted on 2004-08-25
13
184 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

623 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