> Please use a "FixedToolWindow" or "SizableToolWindow".
> You will find this under the "FormBorderStyle" in the properties window in
> the design view.
Sorry , I didn't read you question good enough, and sorry for the late
response (I'm packing all my things, beacuse I'm moving).
I get the small icon on a Sun Java 1.4.2 java.awt.Dialog dialog on WinXP Pro
too.
Do you have a small sample that can show us your scenario.
Regards,
Lars-Inge T?nnessen
Mike Smith - 16 Jul 2004 07:18 GMT
> I get the small icon on a Sun Java 1.4.2 java.awt.Dialog dialog on
> WinXP Pro too. Do you have a small sample that can show us your
> scenario.
Sorry, there was one more piece of info. When you construct the dialog you
need to add two lines to make it modal and fixed size:
dialog.setModal(true);
dialog.setResizable(false);
Doing this make the icon go away on the Sun VM but it remains on the MS VM
(or J#). If I want a modeless dialog I use Frame which has a setIconImage()
method, so I have a workaround for the modeless case.
Here is the complete code:
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class DialogTest {
public static void main(String args[]) {
Dialog dialog = new Dialog(new Frame(), "Applet Frame");
dialog.setLocation(50, 50);
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
dialog.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
dialog.add(new Label("Hello World"));
dialog.setModal(true);
dialog.setResizable(false);
dialog.pack();
dialog.setVisible(true);
}
}
Thank,
Mike