Hello. I can't seem to figure out why my Label won't appear in my
Dialog box....Any Ideas?
//here is the dialog window
class AboutDialog extends Dialog {
//do the setup of the window in the constructor
AboutDialog(Frame in_frame, String in_title, boolean in_modal) {
super(in_frame,in_title,in_modal); // Call ancestor
//Get the location of parent; add 50
Point theP = in_frame.getLocation();
this.setLocation(theP.x + 50, theP.y + 50);
this.setSize(200,200);
// add components to the Dialog window
Panel diPanel = new Panel();
Label nameLabel = new Label("Created by some guy");
diPanel.add(nameLabel);
ExitDialogL theDL = new ExitDialogL(this);
this.addWindowListener(theDL); // have Dialog window take
care of its own window close events
}
......
......
......
etc.
fb - 14 Feb 2006 04:19 GMT
> Hello. I can't seem to figure out why my Label won't appear in my
> Dialog box....Any Ideas?
Nevermind...Figured it out. Somehow I forgot to add the Panel...Oops. :-)
Roedy Green - 14 Feb 2006 04:20 GMT
> this.setLocation(theP.x + 50, theP.y + 50);
> this.setSize(200,200);
The default layout for a dialog is BorderLayout..
Use a proper layout or at least set the layout to null if you want to
code in C.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Vivek - 14 Feb 2006 05:06 GMT
Hi,
See if you have added the panel to the dialog after adding the label to
the panel.
otherwise, do it.
Luck.
vivek
> Hello. I can't seem to figure out why my Label won't appear in my
> Dialog box....Any Ideas?
[quoted text clipped - 25 lines]
> ......
> etc.