aspose file tools*
The moose likes Game Development and the fly likes Point and click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Point and click" Watch "Point and click" New topic
Author

Point and click

Marc Beck
Ranch Hand

Joined: Sep 09, 2006
Posts: 36

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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Sep 09, 2006
Posts: 36
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Point and click