diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/ExpireDialog.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/console/ExpireDialog.java')
| -rw-r--r-- | NET/worlds/console/ExpireDialog.java | 48 |
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; + } +} |