Example #1
0
 private void RemoveBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_RemoveBtnActionPerformed
   // TODO add your handling code here:
   if (!(q.isEmpty())) { // checking if list is empty
     String tmp = (String) q.dequeue();
     DisplayTA.setText(q.display());
   } else { // telling the attentands there are no vehicles
     DisplayTA.setText("There are no No vehicles to be washed!"); // shows if there is no vehicles
   }
 } // GEN-LAST:event_RemoveBtnActionPerformed
Example #2
0
 private void DisplayBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_DisplayBtnActionPerformed
   // TODO add your handling code here:
   int tmp = q.size(); // measuring storage
   if (q.size() > 5) { // warning attendants if there is over 5 vehicles
     DisplayTA.setText("Help Needed");
     DisplayTA.append("\n" + q.display());
   } else { // letting the attendants know how many vehclces are to be washed
     DisplayTA.setText(
         "There are " + tmp + " vehicles to be washed:"); // shows the number of vehicles
   }
 } // GEN-LAST:event_DisplayBtnActionPerformed
Example #3
0
  private void AddBtnActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_AddBtnActionPerformed
    // TODO add your handling code here:
    String tmp = AddF.getText(); // adding vehicle
    if ("".equals(tmp)) {
      DisplayTA.setText("Nothing Entered:");
    } else {
      q.enqueue(tmp);
      AddF.setText("");

      DisplayTA.setText(q.display()); // display vehicle
    }
  } // GEN-LAST:event_AddBtnActionPerformed