How do you redicrect your Java application to another java file -
here's code:
public class cyptography implements actionlistener { jframe frame = new jframe("cyptography"); jtextfield input = new jtextfield(); jbutton decrypt = new jbutton("decrypt"); jtextfield output = new jtextfield(); jbutton encrypt = new jbutton("encrypt"); container north = new container(); jradiobutton scytale = new jradiobutton("scytale"); jradiobutton caesarcipher = new jradiobutton("caesar cipher"); jradiobutton vigenerecipher = new jradiobutton("vigenere cipher"); container south = new container(); public cyptography() { frame = new jframe("cyptography"); frame.setlayout(new borderlayout()); frame.setsize(700,300); north.setlayout(new gridlayout(1,4)); north.add(decrypt); north.add(input); input.addactionlistener(this); north.add(encrypt); north.add(output); output.addactionlistener(this); frame.add(north, borderlayout.north); south.setlayout(new gridlayout(1,3)); south.add(scytale); scytale.addactionlistener(this); south.add(caesarcipher); caesarcipher.addactionlistener(this); south.add(vigenerecipher); vigenerecipher.addactionlistener(this); frame.add(south, borderlayout.south); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setvisible(true); } public static void main(string[] args) { new cyptography(); } @override public void actionperformed(actionevent event) { if (event.getsource().equals(scytale)){ //redirects scytale } else if (event.getsource().equals(caesarcipher)){ //redirects ceasar cipher } else if (event.getsource().equals(vigenerecipher)){ //redirects vigenere cipher } } //decrypt - text has been decoded. public void decrypt() { } //encrypt - convert (information or data) cipher or code, prevent unauthorized access public void encrypt() { } }
these 3 (scytale, caesar cipher, , vigenere cipher) buttons radio buttons. i'm trying get: click onto radio button, want method actionpreformed direct java class. called scytale.java or caesarcipher.java or vigenerecipher.java.
Comments
Post a Comment