Hey, I need some help with an encrypter.
I plan on actually making it use an encryption, but for now Im just having it set letters in the place of previous ones (and vice-versa).
My code that actually contains the encryption is this -
class ListenToEncrypt implements ActionListener { public void actionPerformed(ActionEvent e) { jtfResult.setText(display + ""); { if (jtfResult.getText().equals("a")); jtfResult.setText("K"); } { if (jtfResult.getText().equals("b")); jtfResult.setText("d"); } { if (jtfResult.getText().equals("c")); jtfResult.setText("3"); } { if (jtfResult.getText().equals("d")); jtfResult.setText("R"); } { if (jtfResult.getText().equals("e")); jtfResult.setText("l"); } } }
no matter what I type in, it always gives me 'l', or whatever the last .setText that is registered. I will add every letter in the alphabet, but this is what I have so far.
Thanks