• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Point and click

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you've been working on this since 2008?

sounds very similar to one of your other threads:

https://coderanch.com/t/345812/GUI/java/clicking-icons-does-not-work
 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic