Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Different behavior Win/Mac/Linux

Thread view: 
ffellico@inwind.it - 22 Oct 2005 19:00 GMT
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.
Andrew Thompson - 22 Oct 2005 19:10 GMT
> 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?
ffellico@inwind.it - 23 Oct 2005 07:48 GMT
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.
ffellico@inwind.it - 23 Oct 2005 14:33 GMT
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.
ffellico@inwind.it - 23 Oct 2005 14:54 GMT
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.
Andrew Thompson - 23 Oct 2005 14:56 GMT
> 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>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.