Different behavior Win/Mac/Linux

Discussion in 'Java' started by ffellico@inwind.it, Oct 22, 2005.

  1. Guest

    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.
     
    , Oct 22, 2005
    #1
    1. Advertising

  2. wrote:

    > 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?
     
    Andrew Thompson, Oct 22, 2005
    #2
    1. Advertising

  3. Guest

    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.
     
    , Oct 23, 2005
    #3
  4. Guest

    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.
     
    , Oct 23, 2005
    #4
  5. Guest

    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.
     
    , Oct 23, 2005
    #5
  6. wrote:

    > 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>
     
    Andrew Thompson, Oct 23, 2005
    #6
  7. steve Guest

    On Sun, 23 Oct 2005 21:54:22 +0800, wrote
    (in article <>):

    > 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.
     
    steve, Oct 29, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bart Rider
    Replies:
    9
    Views:
    476
    Chris Uppal
    May 30, 2006
  2. Chris Lyon
    Replies:
    0
    Views:
    340
    Chris Lyon
    Oct 7, 2003
  3. Alessio Pace
    Replies:
    0
    Views:
    644
    Alessio Pace
    Jan 7, 2009
  4. Alex Quinn
    Replies:
    1
    Views:
    271
    Brad Harms
    Feb 23, 2010
  5. Krist
    Replies:
    6
    Views:
    768
    Arne Vajhøj
    May 7, 2010
Loading...

Share This Page