code: private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
  
          JavaProcessBuilder pb = SAMPLE_QUEUE.newProcessBuilder(Locale.getDefault());
          pb.setProcessName("Test 2");
          pb.setProcessPersistence(false);
  
          for (int i = 0; i<=(Integer)jSpinner1.getValue(); i++) {
              pb.setProcessDescription("Test 2");
              pb.setProcessDetails(new TestRunner(), "run", new Class[] {}, new Object[] {});
  
              RunOnce occurrence = new RunOnce();
              RelativeScheduleBuilder rsb = occurrence.newRelativeScheduleBuilder();
              rsb.setRunDelaySeconds((int)(Math.random() * 60));
              rsb.createSchedule();
              pb.setProcessOccurrence(occurrence);
  
              pb.newProcess();
          }
      }
docs: GEN-LAST:event_jButton1ActionPerformed