private void erasePartitionsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_erasePartitionsButtonActionPerformed
        if (jList2.getSelectedValuesList() == null || jList2.getSelectedValuesList().isEmpty()) {
            logger.log(Level.ERROR, "No partition was selected! Please select a partition and try again!");
            return;
        }
        
        if (serialNumber == null || serialNumber.equals("")) {
            logger.log(Level.ERROR, "No device was detected/Value was null! Please connect an Android device in Fastboot-mode to your computer!");
            return;
        }
        
        if (debug) {
            logger.log(Level.DEBUG, "Preparing to erase ,device: " + serialNumber);
            logger.log(Level.DEBUG, "Looping through selection and erase device partition(s)...");
        }
        
        FastbootController fbController = adbController.getFastbootController();
        
        for (Object partition : jList2.getSelectedValuesList()) {
            logger.log(Level.INFO, "Erasing partition " + partition + "...");
            try {
                fbController.executeFastbootCommand(serialNumber, new String[]{"erase", (String) partition});
                logger.log(Level.INFO, "Successfully erased partition " + partition + " on device " + serialNumber);
            } catch (IOException ex) {
                logger.log(Level.ERROR, "An error occurred while erasing device " + serialNumber + ": " + ex.toString() + "\n"
                        + "The error stack trace will be printed to the console. The loop will be broken...");
                ex.printStackTrace(System.err);
                break;
            }
        }
    }//GEN-LAST:event_erasePartitionsButtonActionPerformed