Below I am trying to assign the value of String temp to String test so that it can be worked on outside the actionlistener class. I get an error that the varible must be final or effectively final. Is there a way to get the value of temp outside the class so that it can be worked on?
String test;
textField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
temp = UserScreen.textField.getText();
UserScreen.messageAppend(temp);
test = temp;
}
});