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/ConfirmDialog.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/console/ConfirmDialog.java')
| -rw-r--r-- | NET/worlds/console/ConfirmDialog.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/NET/worlds/console/ConfirmDialog.java b/NET/worlds/console/ConfirmDialog.java new file mode 100644 index 0000000..f0613e4 --- /dev/null +++ b/NET/worlds/console/ConfirmDialog.java @@ -0,0 +1,40 @@ +package NET.worlds.console; + +import java.awt.GridBagConstraints; +import java.awt.Label; + +public class ConfirmDialog extends OkCancelDialog { + private static final long serialVersionUID = 2839131701328189735L; + private String prompt; + + public ConfirmDialog(java.awt.Window parent, DialogReceiver target, String title, String prompt) { + super(parent, target, title, Console.message("No"), Console.message("Yes")); + this.prompt = prompt; + this.ready(); + } + + public ConfirmDialog(java.awt.Window parent, String title, String prompt) { + this(parent, (DialogReceiver)parent, title, prompt); + } + + @Override + protected void build() { + GridBagConstraints c = new GridBagConstraints(); + c.weightx = 1.0; + c.weighty = 1.0; + c.gridwidth = 0; + this.add(this.gbag, new Label(this.prompt), c); + super.build(); + } + + @Override + protected boolean setValue() { + return true; + } + + @Override + public void show() { + super.show(); + this.okButton.requestFocus(); + } +} |