Different behavior Win/Mac/Linux

F

ffellico

I developed a program with a main window and some child window. When I
call a child window I use to disable the main window with the
statement: "this.setEnabled(false);" because ai like to start a new
window in a modal way (I need that the user can't work with the main
window when a child window is on the screen);

What I made work ok in Windows, but it don't work in a Mac computer nor
in a Linux box (in that cases the main window appears to be not
disabled).

To move the program in the three different platforms I use the same
..jar file.

Why this happen?

Thank you. Franco in Italy.
 
A

Andrew Thompson

I developed a program with a main window and some child window. When I
call a child window I use to disable the main window with the
statement: "this.setEnabled(false);" because ai like to start a new
window in a modal way (I need that the user can't work with the main
window when a child window is on the screen);

Why not use an undecorated modal dialog instead?
 
F

ffellico

Good.

I am beginner java programmer (coming from Delphi) so until now I was
not aware that it's possible to create a complex Frame using a JDialog.
Now, with your help I know a little more. Thank you. Franco.
 
F

ffellico

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?

Alternatively how I can execute a public method that is in the main
frame from my dialog?

Thank you. Franco.
 
F

ffellico

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.
 
A

Andrew Thompson

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

steve

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.


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top