I receive this error from within my listener
CallWindow.java:94: local variable txtStartTime is accessed from within inner class; needs to be declared final
String startTime = txtStartTime.getText();
^
startTime is outside this class because they are data that comes from JTextFields residing in a class method. Upon clicking a button, I need to get the code from a text box to manipulate the data.
Here's a code snippet.
add(new JLabel("Label 1"));
JTextField txtStartTime = new JTextField(8);
txtStartTime.addActionListener(listener);
// button code here
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
String startTime = txtStartTime.getText();
Any ideas how I can get to the data in the Jtext fields?