Article View: borland.public.jbuilder.java.language
Article #17812Frames and Dialog Boxes
From: Richard Ulrich
Date: Fri, 25 Sep 1998 00:00
Date: Fri, 25 Sep 1998 00:00
26 lines
1353 bytes
1353 bytes
Hello, We have an application where modal JDialog boxes create and call other modal dialog boxes, sometimes four levels deep. Each time, these dialog boxes need a JFrame argument to be instantiated. We have thought of four or five ways to do this. (1) create (and dispose of) a new frame to create each non-primary dialog box. (2) make the application frame public and use that. (3) Add a "myFrame" variable to each dialog box so that it keeps a reference to the frame used in its constructor. (This variable will always be identical to the application frame, I think.) (4) Create all of the dialog boxes in the main application, but don't show them, so that they are all instantiated for the life of the program (much like what happens by default in C-Builder and Delphi). A fifth way, passing "null" as the frame, does not work very well. Any comments on the pros and cons of the above alternatives? Thanks, Richard Ulrich
Technical Details
Message-ID:
<01bde88a$f06edc50$d8b5aec7@uai-4>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,34300cf42693a390,start X-Google-Attributes: gidf74b3,public From: "Richard Ulrich" <rm_ulrich@compuserve.com> Subject: Frames and Dialog Boxes Date: 1998/09/25 Message-ID: <01bde88a$f06edc50$d8b5aec7@uai-4> X-Deja-AN: 394726495 Organization: Ulrich Associates, Inc. Newsgroups: borland.public.jbuilder.java.language