• Post Reply Bookmark Topic Watch Topic
  • New Topic

JLabel is not shown

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone advice the way to do this thing. I have a picture and whenever the user presses the point in my picture it shows him the coordinates. I tried to do it via Mouse adapter but I am stuck because it does not show the JLabel with the coordinates what is wrong???
Here is my code
 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bobby Marvikuan wrote:Can anyone advice the way to do this thing. I have a picture and whenever the user presses the point in my picture it shows him the coordinates. I tried to do it via Mouse adapter but I am stuck because it does not show the JLabel with the coordinates what is wrong???


You need to add the JLabel to some component, just setting visible-true doesnt make it visible on the GUI unless its part of some parent component.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:
Bobby Marvikuan wrote:Can anyone advice the way to do this thing. I have a picture and whenever the user presses the point in my picture it shows him the coordinates. I tried to do it via Mouse adapter but I am stuck because it does not show the JLabel with the coordinates what is wrong???


You need to add the JLabel to some component, just setting visible-true doesnt make it visible on the GUI unless its part of some parent component.

cheers!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!