How to use a label in Java?
796315Dec 20 2009 — edited Dec 22 2009Hi. Does anyone know how to add a label to jframe so I can display some text? I am asking this because I have a program where it displays text when clicking on certain regions but the text appears behind the background image. How can I make the text I want to display appear on top and not behind the bgimage?
This is text I am using to test it and diplay a text :
String message="";
..........
g.drawString(message,50,50);
.................
if(xxxx>=whole_flag.getX() && yyyy>=whole_flag.getY()){message = "You clicked on the flag";}
Thanks in advance.
PS: I am not using an Applet.