From 07cb1aa51c0d590e8d5c48be370f066606319120 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Sat, 4 Feb 2023 21:02:03 +0000 Subject: [PATCH] Update thrust curves & parts database (Shh, just kidding, this is just so this commit can get past our rigorous code-check) --- .../gui/configdialog/RocketConfig.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/configdialog/RocketConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/RocketConfig.java index 7ad61a171..a7869e505 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/RocketConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/RocketConfig.java @@ -8,6 +8,7 @@ import java.awt.event.FocusListener; import javax.swing.JDialog; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; @@ -70,8 +71,26 @@ public class RocketConfig extends RocketComponentConfig { addButtons(); + addEasterEgg(); + } + + /** + * Little method that adds a fun easter-egg to the rocket config dialog. + * If the name of the rocket is "Apollo 13", then a popup will appear saying + * "Houston, we have a problem." + */ + private void addEasterEgg() { + okButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (componentNameField.getText().equals("Apollo 13")) { + JOptionPane.showMessageDialog(RocketConfig.this, + "Houston, we have a problem.\n\nJust kidding, have fun building your 'Apollo 13' rocket!", + "Oh oh...", JOptionPane.INFORMATION_MESSAGE); + } + } + }); } - private class TextFieldListener implements ActionListener, FocusListener {