Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I do I check Points inside a jPanel  RSS feed

 
Karl Castillo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a problem about my program. My mouselistener - mouseclicked - has to get a point and check all my panels if they have that point. Every time I click on a square, the selected square is always the upper left corner. The squares are individual panels on a main panel that has a grid layout. What is wrong with my code?



Thanks
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To increase your chances of getting help you should create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is probably that the panel (square) you actually click on catches the event and doesn't propagate it to its parent.
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
deleted
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!