AGAIN.
Just now I solved the last problem (I am able now to set the varable in
the main window from the dialog).
But is strange, again I have the original problem: the dialog is modal
in Windows but in Linux e Mac the dialog window appear to be
modeless.
Could be the problem caused by the different version of Java? I will
check this for now.
If someone have some other idea, please suggest me. Thanks. Franco.
steve - 29 Oct 2005 10:40 GMT
> AGAIN.
>
[quoted text clipped - 9 lines]
>
> If someone have some other idea, please suggest me. Thanks. Franco.
no it is the crappy windows at fault.
on windows there has to be only 1 main window for an application, all others
are child windows of that.
on linux & mac, an application can have multiple main windows.
But what will really bust ur noggin , is when you have a modal jdialog of a
modal Jdialog of a modal jdialog.
and that might not be as strange as it seems.
Steve.
> Now I have another problem that come up after I have converted my Child
> Frame in a modal Dialog:
>
> How I can set a String variable that is in the main frame from my
> dialog?
I guess you do not need it to change until the Dialog closes?
This example might work for you.
<http://www.physci.org/launcher.jsp?class=/codes/AWT2/SampleDialog>
It is written in AWT, but shows how to provide information from
the dialog back to the parent Frame.
In that example, the buttons are owned by the frame
and simply provided to the dialog, though there are
a number of ways of doing it (usually less kludgy and
better designed).
> Alternatively how I can execute a public method that is in the main
> frame from my dialog?
I might approach it the other way around, and provide
a method of the dialog such as isUpdate(). That way,
as soon as the dialog closes, the frame can call the
method of the dialog to find out the answer or information
it needs.
BTW - I forgot to mention.
There is a group dedicated to discussing GUI's..
<http://www.physci.org/codes/javafaq.jsp#cljg>