Help with drawing a string using mouse events

Hey guys, I'm trying to create a string in the position that I click on a JFrame, but I get an error that the values for my x and y cannot be accessed from outside the package and I'm rather confused. I would appreciate any help!

Your x and y variables are declared inside the mouseClicked method and are only visible inside of that method. You want to make these variables non-static class variables so that they're visible throughout the class.