in
is declared within RecordViewerPanel()
. Its scope is within the {}
for the try/catch
block. Hence in the following line:
String first = in.readUTF();
in
is not something that is recognized by Java which is the reason for the error message Cannot find variable in
.
You can fix this problem by passing in
around or by declaring it such that it is within the scope of where it is being called or used.
Also fix the following line:
String last = in.redUTF();
to
String last = in.readUTF();
Again though, make sure in
is in scope.