I have this simple method:
public void setComboBoxItems(List<User> users, List<Client> clients) {
for (User user : users) {
usersIds.addItem(user.getId());
}
for (Client client : clients) {
clientsIds.addItem(client.getId());
}
}
What it does is add items to 2 JComboBox , the items added are the ID of the Users and Clients contained in the 2 lists of name users- clients .
Is there any way to simplify this method, maybe by calling users.forEach()
?