when i try to call a method from actionPerformed lets say “text1.setText(“asdasdasd”);” (text1 object already created in constructor of TestBookShelf) it says me cannot resolved type .but it works in constructor.i’m kinda newbie but shouldn’t all crap from TestBookShelf class be available to actionPerformed method?
i’m not allowed to post photo as i have only 6 reps


when i try to call a method from actionPerformed lets say text1.setText(asdasdasd); (text1 object
Share
My guess is
text1is in fact local to the constructor.So in your constructor you are doing:
If that’s true,
text1must be declared as an instance variable, then would it be resolved.Like so: