passing control from GUI back to main.class

This may be a stupid question but.....

I have a main.java file that contains the main class, and then main calls another class which is a GUI. This bit works fine.

Next, the user presses the OK button, the event handler reads in the text fields and assigns to variables, then I want control to pass back to main.java to the main class - how would i do this?

Thanks

[390 byte] By [clarkana] at [2007-11-26 18:56:56]
# 1

Well your main class should use a "modal dialog".

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.

camickra at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 2
Off topic! Camickr, how do you write the web-links in this forum? If I use "normal" HTML as in<a href=" http://www.somePage.html">SSCCE</a>the angle brackets are not interpreted, and replacing them with &lt; for example, doesn't help either.J鰎g
Joerg22a at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 3
Respond to my posting and click "Quote Original" to see the exact code.You use: [ url http://.... ]Your Description[/url ] (without the spaces in the tags)
camickra at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 4

>Off topic!

>

> Camickr, how do you write the web-links in this

> forum? If I use "normal" HTML as in

> <a href="http://www.somePage.html">SSCCE</a>

> the angle brackets are not interpreted, and replacing

> them with < for example, doesn't help either.

>

> J鰎g

Reply to his post and press the "Quote Original" button and you will see what he did.

zadoka at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 5
Aha!Thank you.
Joerg22a at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 6

If I use modal dialog, does that mean that I will have a tabbed frames?

Would this method work:

start a new thread in main(), that was started after control was passed to the GUI so they both run concurrently. Then GUI still runs while new thread runs the main code to produce the results which will then be passed back to the GUI?

Thanks

-I would post code up, but they are quite long files and I don't know how to show you all the information succinctly

clarkana at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...
# 7

> If I use modal dialog, does that mean that I will

> have a tabbed frames?

Not sure what you mean by tabbed frames?

>

> Would this method work:

> start a new thread in main(), that was started after

> control was passed to the GUI so they both run

> concurrently. Then GUI still runs while new thread

> runs the main code to produce the results which will

> then be passed back to the GUI?

Yea, just make sure updates to the GUI are done on the Event Dispatching Thread.

http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html

zadoka at 2007-7-9 20:36:06 > top of Java-index,Desktop,Core GUI APIs...