What about this isn't allowing me to use my button or compare strings?
<p>My goal is to compare two strings. One string is just the input from a user from a textfield (txt), and then, if they match, to change the textfield to a third string (msg). </p>

<p>However, when I enter the correct characters for the txt string and click the button, nothing happens. Why isn't it changing to "Derk?", the msg string?</p>

<p>Code:</p>

<pre><code>package levels;


import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;


public class LevelOne extends JFrame implements ActionListener{

    private JTextField input = new JTextField("Ich spielen Golf.");     
    private JButton submit = new JButton("Check sentence");


    public void one(){

        setTitle("Conjugator");
        setSize(400,400);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setVisible(true);


        setLayout(new BorderLayout());
        setContentPane(new JLabel(new ImageIcon("images/LevelOneBG.gif")));
        setLayout(new FlowLayout());

        JTextArea area = new JTextArea("You enter a castle. A Goblin demands you correct his sentences!");
        add(area);
        setVisible(true);

        JButton submit = new JButton("Check sentence");
        submit.addActionListener(this);
        add(submit);
        setVisible(true);
        JTextField input = new JTextField("Ich spielen Golf.");
        input.setActionCommand("input");
        add(input);
        input.addActionListener(this);
        setVisible(true);


    }   


    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == submit) {

            String txt = (input.getText());
            String test = ("test");
            String msg = ("Derk?");

            if (txt.equals(test)){
                //after check
                input.setText(msg); 
            }
        }
    }
}
</code></pre>
