Last active
September 4, 2015 18:16
-
-
Save bitbrain/1e7ac33ff98d6c225f63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float[] euroKurse = { | |
0.93f, // Wechselkurs, Währung 1 | |
4.49f, // Wechselkurs, Währung 2 | |
1.29f, // Wechselkurs, Währung 3 | |
3.49f // Wechselkurs, Währung 4 | |
}; | |
String[] kursNamen = { | |
"Yen", // Name, Währung 1 | |
"Dollar", // Name, Währung 2 | |
"Franken", // Name, Währung 3 | |
"Kronen" // Name, Währung 4 | |
}; | |
int ausgewaehlterIndex = jComboBox.getSelectedIndex(); | |
float aktuellerKurs = euroKurse[ausgewaehlterIndex]; | |
float neuerBetrag = Float.valueOf(jTextField.getText()) * aktuellerKurs; | |
outputLabel.setText(String.valueOf(neuerBetrag) + kursNamen[ausgewaehlterIndex]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment