java - Button logic ignored-why? -


I am writing a cipher program which will be in regular terms and will convert them to a fixed "code". Everything is done, but the program submit button is ignoring the code. What do I need to do to fix this?

  import javax.swing. *; Import java.io * *; Import java.awt.event. *; Import java.awt. *; Public class decodes JFrame (private JTextArea textaci; private JTextArea textaclr; private Jeelabl Lckiyr; private Jeelbl Liker, private Jebtn Bisbimti; private String Cleartekst; private String Sifrtekst; private boolean clrtoci; public decode () {super (); setTitle ( "Decoder "SetSize (300,200); setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); SetLayout (new gridboutout ()); Gridbag Consultants c = New Gridbag Consultants (c); c.fill = GridBagConstraints.VERTICAL; c.weightx = 0.5; Textaci = new JTextArea (); Textaclr = New JTextArea (); Lclear = New JS Label ( "Cletetekst:"); Lisfr = new Jeelabel ( "Sifrtekst:"); Bsubmit = new Jebtn ( "Submit"); BsubmitksetActionCommand ( "enabled"); TextaciksetEditable (right); TextaciksetLineWrap (right ); textaclr.setEditable (right); textaclr.setLineWrap (right); textaci.setText (cipher); c.gridx = 0; c.gridy = 0; add (Lclear); c.gridx = 1; c.gridy = Add; (Textaclr); c.gridx = 0; c.gridy = 2; (lcipher); c.gridx = 3; c.gridy = 4; add (textaci); add (bsubmit); // ------------------------------------------------ ---------------------------- \\ TextFieldHandler Hand = New TextFieldHandler (); Bsubmit.addActionListener (hand); SetVisible (true); } Public Class TextField handler action Alicer applies {Public Zero Action Perfarm (Action Event Event) {if (event.getSource () == bsubmit) {cleartext = textaclr.getText (); Int cleartextl = cleartext.length (); If (textaci.getText () == faucet) {clrtoci = true; } And {clrtoci = false; } If {clrtoci == true} {// If this is the claytext of seafretext for {int i = 0; i & gt; = cleartextl; i ++}, {if (cleartext.contains ("a")) { Ciphertext = "3"; } If (Clairetext constant ("b")) {ciphertext = "b"; } // and for the same remaining characters) // end statement for textte.ci.text (ciphertext); SetVisible (true); System.out.print (cipher); } // if it is the claytext of ciphertext} // bsubmit logic // // eventListener public static zero main (string [] args) {new decode (); }}    

"But the program submit button is ignoring the code. "

Define the "Ignore" button works fine for me just to see the code to execute parts of the code. Just some system. Out.printLin (...) Add statements.

Always in the event of the situation if the code will always be the source after the submit button.

You have to reconstruct your argument because the second position will never be executed.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -