summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ExpireDialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/ExpireDialog.java')
-rw-r--r--NET/worlds/console/ExpireDialog.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/NET/worlds/console/ExpireDialog.java b/NET/worlds/console/ExpireDialog.java
new file mode 100644
index 0000000..7b1f80f
--- /dev/null
+++ b/NET/worlds/console/ExpireDialog.java
@@ -0,0 +1,48 @@
+package NET.worlds.console;
+
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Dialog;
+import java.awt.Event;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Panel;
+import java.text.DateFormat;
+import java.util.Date;
+
+class ExpireDialog extends Dialog {
+ private static final long serialVersionUID = -1622362025617429254L;
+ protected Button button;
+ private static Font font = new Font(Console.message("ButtonFont"), 0, 12);
+
+ public ExpireDialog(Date expireDate) {
+ super(null, GammaFrame.getDefaultTitle(), false);
+ this.setLayout(new BorderLayout(15, 15));
+ this.add("Center", new MultiLineLabel(Console.message("beta-expired") + DateFormat.getDateTimeInstance().format(expireDate), 20, 20));
+ this.button = new Button(Console.message("OK"));
+ this.button.setFont(font);
+ Panel p = new Panel();
+ p.setLayout(new FlowLayout(1, 15, 15));
+ p.add(this.button);
+ this.add("South", p);
+ this.pack();
+ }
+
+ @Override
+ public boolean action(Event e, Object arg) {
+ if (e.target == this.button) {
+ this.hide();
+ this.dispose();
+ Main.end();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean gotFocus(Event e, Object arg) {
+ this.button.requestFocus();
+ return true;
+ }
+}