title: Jlabel change color on mouse click Java
body: <p>I am adding multiple Jlabel using for loop. What I want is on mouse click, the color of the selected <code>JLabel</code> should change and set to the default color on click of another<code>JLabel</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/SgJaa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SgJaa.png" alt="enter code here"></a></p>