How to use this code with mousePressed?

I want to make it like when and where i click the mouse this will appear there only. I am unable to figure out. would u plz help me?

1 Like