Hi all!
Could someone pliz explain me how to delete a component (in my case -> JLabel that is placed on JLayeredPane), when it is double-clicked? So, as far as I understand, I must first just detect a componment that is double-clicked and then delete it. Although an idea is simple, my code doesn't work correctly:
public void mouseClicked(MouseEvent e)
{
if (e.getClickCount() == 2)
{
this.layeredPane.remove(e.getComponent());
this.layeredPane.repaint();
System.out.println(e.getSource());
}
}
Pliz helppp!:'(
Thx!