-1
I have a question:
I have a method that goes through a list of clients and in it checks if it is the type countSolidaria =3 , every time the method goes through this list he gives an Alert showing one to the user with a joptionpane that he and Solidario.
I would like to know how to do for that same method go through the list but only show once to the user that message only once, once he went 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");
}
}
}
Just limit to the JOPTIONPANE. appear once , someone would have some idea how to do this?
Please supply one [mcve] so that we can test the code and propose a solution.
– user28595
This code is not executable, has several libs there q are not part of java
– user28595