private void setZoomFromZoomComboBox() {
        if (reflectingZoomInZoomComboBox)
            return;
        final int selIndex = zoomComboBox.getSelectedIndex();
        float[] zoomLevels = documentViewController.getZoomLevels();
        if (selIndex >= 0 && selIndex < zoomLevels.length) {
            float zoom = 1.0f;
            try {
                zoom = zoomLevels[selIndex];
            } catch (IndexOutOfBoundsException ex) {
                logger.log(Level.FINE, "Error apply zoom levels");
            } finally {
                if (zoom != documentViewController.getZoom()) {
                    setZoom(zoom);
                }
            }
        } else {
            boolean success = false;
            try {
                Object selItem = zoomComboBox.getSelectedItem();
                if (selItem != null) {
                    String str = selItem.toString();
                    str = str.replace('%', ' ');
                    str = str.trim();
                    float zoom = Float.parseFloat(str);
                    zoom /= 100.0f;
                    if (zoom != documentViewController.getZoom()) {
                        setZoom(zoom);
                    }
                    success = true;
                }
            } catch (Exception e) {
                // Most likely a NumberFormatException
                success = false;
            }
            if (!success) {
                Toolkit.getDefaultToolkit().beep();
            }
        }
    }