I have a question:
I have a method that walks through a list of clients and in it checks if it is of type accountSolidaria = 3, every time the method goes through this list it gives an alert showing a user with a joptionpane that he is supportive. p>
I would like to know how to do this same method scrolls through the list but only once to show the user this message once once it has gone through the list.
private static final short SOLIDARIA = (short) 3;
clienteController = new ClienteController(session);
List<ContaCorrenteModel> contaCorrenteModelList = new ArrayList<ContaCorrenteModel>();
contaCorrenteModelList = clienteController.teste(Short.valueOf(Short.parseShort(banco)),
Short.valueOf(Short.parseShort(agencia)), Long.valueOf(Long.parseLong(conta)));
for (ContaCorrenteModel contaCorrenteModel : contaCorrenteModelList) {
if (contaCorrenteModel.getNrSequNatzCnta().getCdNatzCnta() == SOLIDARIA) {
JOptionPane.showMessageDialog(null, "A CONTA E TIPO 3");
}
}
}
Only limit to JOPTIONPANE. to appear once, would anyone have any idea how to do this?