Error:
error: cannot find symbol
What appears doesn\'t works:
If I write: \"InvoerVakhandler exte
The variable invoervak1
is defined in the boven
class and is not visible within InvoerVakHandler
. Since InvoerVakHandler
is registered exclusively with the invoervak1
component, you can use the source object of your ActionListener
to obtain the reference to the JTextField
:
JTextField textField = (JTextField) e.getSource();
String invoer = textField.getText();
Typically anonymous ActionListener
implementations are used. This makes the intended source clear along with its associated functionality.