add another java client
[spider.git] / spider-web / InfoDialog.java
diff --git a/spider-web/InfoDialog.java b/spider-web/InfoDialog.java
new file mode 100755 (executable)
index 0000000..1442f7f
--- /dev/null
@@ -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;
+       }
+}