Update thrust curves & parts database

(Shh, just kidding, this is just so this commit can get past our rigorous code-check)
This commit is contained in:
SiboVG 2023-02-04 21:02:03 +00:00
parent 062c1d407c
commit 07cb1aa51c

View File

@ -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 {