Skip to content

Instantly share code, notes, and snippets.

@corusm
Created November 21, 2018 22:02
Show Gist options
  • Save corusm/8fbebb18dfec278da983afbe65612604 to your computer and use it in GitHub Desktop.
Save corusm/8fbebb18dfec278da983afbe65612604 to your computer and use it in GitHub Desktop.
String klartext = jTextField1.getText();
int vers = jNumberField1.getInt();
int[] va = new int[klartext.length()];
if (vers>25) {
vers= vers-25;
} // end of if
for (int i=0;i<va.length;i++) {
va[i] = klartext.charAt(i);
}
for (int n=0;n<va.length;n++) {
va[n]=va[n]+vers;
if (va[n]+vers>=123) {
va[n]=va[n]-25;
}
}
jLabel1.setText("");
for (int y=0;y<va.length;y++) {
char bla = (char) va[y];
jLabel1.setText(jLabel1.getText()+ bla);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment