Hi!
I'm trying to create borders around JLabel components. However, the line c[i].setBorder(border)
cannot be compiled. Please, help me to improve this code. Thanks!
public void mouseReleased(MouseEvent e) {
if (Menu.getgroup()) {
Component[] c = getComponents();
Border border = LineBorder.createGrayLineBorder();
for(int i = 0; i < c.length; i++)
{
if(c[i] instanceof JLabel)
{
Rectangle selectedLab = c[i].getBounds();
if(selection.contains(selectedLab))
{
c[i].setBorder(border);
}
}
}
selection = null;
repaint();
}
}