REALLY SORRY FOR THE BAD QUESTION. HERE'S AN EXAMPLE OF MY CURRENT CODING. BASICALLY I TAKE THE INPUT FROM A TEXTFIELD. SO HOW DO I STORE AND RETRIEVE THE INPUT?
String input = txtInput.getText();
StringBuilder builder = new StringBuilder();
char[] charArray = input.toCharArray();
for(int i = 0; i < charArray.length; i +=2)
{
if(i+1 < charArray.length)
{
//even
builder.append(charArray[i+1]);
}
//odd
builder.append(charArray[i]);
}
String flippedText = builder.toString();
lblencryted.setText(flippedText);
for(int i = 0; i < 100; i++){
String[] storeArray = {flippedText};
}
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String input = txtInput.getText();
StringBuilder builder = new StringBuilder();
char[] charArray = input.toCharArray();
for(int i = 0; i < charArray.length; i +=2)
{
if(i+1 < charArray.length)
{
//even
builder.append(charArray[i+1]);
}
//odd
builder.append(charArray[i]);
}
String flippedText = builder.toString();
lblretrieve.setText(flippedText);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Encryption().setVisible(true);
}
});
}