I have a problem in my project, I would like to know how to add an else statement to an "group" of If I have in my project, when I add the else of the group of if it tells me that the else has problems since it does not find the if. I hope you can help me, thank you very much in advance.
class Manejador implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
String pal;
if(bcc.isEnabled()) {
pal = JOptionPane.showInputDialog("Porfavor, digite el grupo que desea consultar:");
{
if(pal.matches("Grupo A"))
JOptionPane.showMessageDialog(null,pal+"\n Rusia\n Arabia Saudi\n Egipto\n Uruguay");
if(pal.matches("Grupo B"))
JOptionPane.showMessageDialog(null,pal+"\n Portugal\n España\n Marruecos\n Irán");
if(pal.matches("Grupo C"))
JOptionPane.showMessageDialog(null,pal+"\n Francia\n Australia\n Peru\n Dinamarca");
if(pal.matches("Grupo D"))
JOptionPane.showMessageDialog(null,pal+"\n Argentina\n Islandia\n Croacia\n Nigeria");
if(pal.matches("Grupo E"))
JOptionPane.showMessageDialog(null,pal+"\n Brasil\n Suiza\n Costa Rica\n Serbia");
if(pal.matches("Grupo F"))
JOptionPane.showMessageDialog(null,pal+"\n Alemania\n Mexico\n Suecia\n Corea del Sur");
if(pal.matches("Grupo G"))
JOptionPane.showMessageDialog(null,pal+"\n Bélgica\n Panamá\n Túnez\n Inglaterra");
if(pal.matches("Grupo H"))
JOptionPane.showMessageDialog(null,pal+"\n Polonia\n Japon\n Colombia\n Senegal");
}
}
}
}