This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Point and click

 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am working on a point and click strategy game, so this might fit into the game development section as well as into the GUIsection.
I have a grid map, which extends JPanel. On that grid map, I have my units (planets, spacecraft) as JLabels. A mouse listener checks if a grid square that contains a unit has been clicked on (by using the coordinates), and then opens a menu that lets you move the selected unit, etc. Everything worked fine until I added tooltips that would display information about each unit. Now I can no longer click on the unit itself, but have to click somewhere on the grid square away from the unit to get the menue. And even then it does not always work. Please let me know what I did wrong and how I can fix it. Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you've been working on this since 2008?

sounds very similar to one of your other threads:

http://www.coderanch.com/t/345812/GUI/java/clicking-icons-does-not-work
 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote this program several years ago. Then I got too busy with other things and stopped working on it. Earlier this year I decided to start it over from scratch and now I realize that I have run into exactly the same problem as the first time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic