private boolean confirmOperation(final BatchOperation operation,final ArrayList<Pokemon> pokes){
  final JPanel panel=buildPanelForOperation(operation,pokes);
  final int response=JOptionPane.showConfirmDialog(null,panel,String.format("Please confirm %s of %d Pokémon",operation,pokes.size()),JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE);
  return response == JOptionPane.OK_OPTION;
}

private boolean confirmOperation ( final BatchOperation operation , final ArrayList < Pokemon > pokes ) { final JPanel panel = buildPanelForOperation ( operation , pokes ) ; final int response = JOptionPane . showConfirmDialog ( null , panel , String . format ( "Please confirm %s of %d Pokémon" , operation , pokes . size ( ) ) , JOptionPane . OK_CANCEL_OPTION , JOptionPane . PLAIN_MESSAGE ) ; return response == JOptionPane . OK_OPTION ; }
prompt for confirmation before doing the operation .
