Hi!

There is JPanel with multiple JLabel components. I would like to change the border color of JLabel component that is clicked on. I tried this.getComponentAt(e.getX(), e.getY()).setBorder(solidBorder) , but it did not work... How could I solve this task?

I created a class that extends ArrayList and implements MouseListener. The ArrayList contains JLabel components. So, the problem is solved:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.