X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=spider-web%2FInfoDialog.java;fp=spider-web%2FInfoDialog.java;h=1442f7f040537655aeebf751f3f1f5c3456c9b31;hb=f319bf06d72d135e7ec14ff8b27627187f5e2595;hp=0000000000000000000000000000000000000000;hpb=55f14d9038abb44d61ac63298f9f39b9e53a39d1;p=spider.git diff --git a/spider-web/InfoDialog.java b/spider-web/InfoDialog.java new file mode 100755 index 00000000..1442f7f0 --- /dev/null +++ b/spider-web/InfoDialog.java @@ -0,0 +1,38 @@ +import java.awt.*; + +public class InfoDialog extends Dialog { + protected Button button; + protected MultiLineLabel label; + + + public InfoDialog(Frame parent, String title, String message) { + super(parent, title, false); + + this.setLayout(new BorderLayout(15,15)); + label = new MultiLineLabel(message, 20, 20, 1); + this.add("Center", label); + + button = new Button("OK"); + Panel p = new Panel(); + p.setLayout(new FlowLayout(FlowLayout.CENTER, 15, 15)); + p.add(button); + this.add("South", p); + + this.pack(); + this.show(); + } + + public boolean action(Event e, Object arg) { + if (e.target == button) { + this.hide(); + this.dispose(); + return true; + } + else return false; + } + + public boolean gotFocus(Event e, Object Arg) { + button.requestFocus(); + return true; + } +}