Hey so i have a class that extends a JFrame with an image of mickey mouse and a piece of cheese. I have made it so the user can control Mickey and I want to have it so that when he touches the boundaries of the cheese a YOU WIN string is displayed on top of the JFrame without disrupting any of the background....I can figure out that logic.

HOWEVER my problems is that I cant even get text, or any string to be displayed on my JFrame. any help? I can provide my code, but I think an epxlanation could be done w/o it and it would just complicate things.


There is a class JLabel that you can use to add text. You can hide a JLabel containing the text "YOU WIN" (setVisible(false)) and when the bounds of the image intersect to ones of the cheese, then you can make it visible again (setVisible(true)).