Skip to content

Instantly share code, notes, and snippets.

@getflourish
Created January 16, 2011 17:53
Show Gist options
  • Save getflourish/781982 to your computer and use it in GitHub Desktop.
Save getflourish/781982 to your computer and use it in GitHub Desktop.
public void actionPerformed (ActionEvent arg0) {
// Jahreszahl wird eingelesen und umgewandelt
eingabe = jahr.getText();
try {
jahreszahl = Integer.parseInt(eingabe);
// Methode istSchaltjahr wird aufgerufen
schaltjahr = istSchaltjahr(jahreszahl);
// Entscheidung, ob ein Schaltjahr vorliegt
if (schaltjahr){
kEin.setText("ein");
} else {
kEin.setText("kein");
} // Ende if
} catch (NumberFormatException e) {
kEin.setText("");
}
} // Ende actionPerformed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment