home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.peer.DialogPeer;
-
- public class Dialog extends Window {
- boolean resizable;
- boolean modal;
- String title;
-
- public Dialog(Frame parent, boolean modal) {
- super(parent);
- this.resizable = true;
- this.modal = modal;
- }
-
- public Dialog(Frame parent, String title, boolean modal) {
- this(parent, modal);
- this.title = title;
- }
-
- public synchronized void addNotify() {
- if (super.peer == null) {
- super.peer = ((Window)this).getToolkit().createDialog(this);
- }
-
- super.addNotify();
- }
-
- public boolean isModal() {
- return this.modal;
- }
-
- public String getTitle() {
- return this.title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- DialogPeer peer = (DialogPeer)super.peer;
- if (peer != null) {
- peer.setTitle(title);
- }
-
- }
-
- public boolean isResizable() {
- return this.resizable;
- }
-
- public void setResizable(boolean resizable) {
- this.resizable = resizable;
- DialogPeer peer = (DialogPeer)super.peer;
- if (peer != null) {
- peer.setResizable(resizable);
- }
-
- }
-
- protected String paramString() {
- String str = super.paramString() + (this.modal ? ",modal" : ",modeless");
- if (this.title != null) {
- str = str + ",title=" + this.title;
- }
-
- return str;
- }
- }
-