Java won't recognize defined variables?
<p>In <code>actionPerformed</code> it seems that all variables (submit, msg, input) "cannot be resolved" according to Eclipse. In my experience (of which I have very little) this means that I have not defined the variables. But, as you can see in the code, I have defined them. Submit is a JButton, msg is a string, input is a JTextField. </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.*;

import java.util.*;

public class LevelOne extends JFrame implements ActionListener{

    private Object msg;

    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);

        //these aren't being called to actionPerformed
        JButton submit = new JButton("Check sentence");
        submit.addActionListener(this);
        setVisible(true);
        JTextField input = new JTextField("Ich spielen Golf.");
        input.setActionCommand("input");
        add(input);
        input.addActionListener(this);
        setVisible(true);

        String msg = ("Test successful");
    }   

    //this should be successfully locating and utilizing "submit", "input" and "msg", but it won't
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == submit) {
            msg = submit.getText();

            //!!  Display msg only **after** the user has pressed enter.
            input.setText(msg); 
        }

    }
}
</code></pre>

<p>I am aware some of my imports are unnecessary.</p>

<p>P.S., i'm making a small text adventure game for my German class</p>
