Article View: borland.public.jbuilder.java.language
Article #19250On Dialogs
From: Conrad Hoesle-Kienzlen
Date: Thu, 19 Feb 1998 00:00
Date: Thu, 19 Feb 1998 00:00
40 lines
1586 bytes
1586 bytes
JBuilder online (and printed) documentation is wrong on Dialogs. It
states that a Dialog must be constructed with a parent frame (and
therefore cannot be made into a bean). This is not necessary. One can
create a new dialog with:
Dialog myDialog = new Dialog(new Frame());
and one can create a bean with:
public class DialogBean extends Dialog {
Panel messagePanel = new Panel();
static Frame frm = new Frame(); // <------- this is the
trick!!!!!!!!!
BorderLayout borderLayout1 = new BorderLayout();
.........
// the main constructor
private DialogBean(Frame frame, String title, boolean modal) {
super(frm, title, modal);
try {
jbInit();
}
catch (Exception e) { e.printStackTrace(); }
add(messagePanel, "Center");
}
// parameterless constructor for the bean
public DialogBean() {
this(frm, "", true);
}
public void jbInit() throws Exception {
this.addWindowListener(new DialogBean_this_windowAdapter(this));
messagePanel.setLayout(borderLayout1);
.......
}
........
Hope, this helps somebody,
Conrad
Technical Details
Message-ID:
<34ECB0F1.75915074@csi.com>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,597eca2139f62518,start X-Google-Attributes: gidf74b3,public From: Conrad Hoesle-Kienzlen <Conrad_Hoesle@csi.com> Subject: On Dialogs Date: 1998/02/19 Message-ID: <34ECB0F1.75915074@csi.com> X-Deja-AN: 326732610 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: CHK IT-Consulting Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language