Chrissirhc
Programmer
Hello I have problem which I'm not too sure how to solve.
I have a JPanel. Within this JPanel I have x JComponents. Where x is abritrary number. Anyway I have implemented mouseMotionListener so I can handle events in the JComponent when I do something in them say for instance click on one of the circles inside it it goes red. If I click on another circle within that same JComponent the last clicked one goes back to black and the present becomes red. However if I click on another circle in a different JComponent there will be two red ones. One in each JComponent.
I would like for the JPanel to know when a different JComponent is clicked on but as the mouseListener is in the JComponent class it won't know which JComponent has been clicked on. My JComponents are in a vector in the JPanel.
Chris
I have a JPanel. Within this JPanel I have x JComponents. Where x is abritrary number. Anyway I have implemented mouseMotionListener so I can handle events in the JComponent when I do something in them say for instance click on one of the circles inside it it goes red. If I click on another circle within that same JComponent the last clicked one goes back to black and the present becomes red. However if I click on another circle in a different JComponent there will be two red ones. One in each JComponent.
I would like for the JPanel to know when a different JComponent is clicked on but as the mouseListener is in the JComponent class it won't know which JComponent has been clicked on. My JComponents are in a vector in the JPanel.
Chris