private void updateDisplayChoices() {
        if (!fullscreenBox.isSelected()) {
            // don't run this function when changing windowed settings
            return;
        }
        String resolution = (String) displayResCombo.getSelectedItem();
        String colorDepth = (String) colorDepthCombo.getSelectedItem();
        if (colorDepth == null) {
            colorDepth = source.getBitsPerPixel() + " bpp";
        }
        String displayFreq = (String) displayFreqCombo.getSelectedItem();
        if (displayFreq == null) {
            displayFreq = source.getFrequency() + " Hz";
        }

        // grab available depths
        String[] depths = getDepths(resolution, modes);
        colorDepthCombo.setModel(new DefaultComboBoxModel<>(depths));
        colorDepthCombo.setSelectedItem(colorDepth);
        // grab available frequencies
        String[] freqs = getFrequencies(resolution, modes);
        displayFreqCombo.setModel(new DefaultComboBoxModel<>(freqs));
        // Try to reset freq
        displayFreqCombo.setSelectedItem(displayFreq);

        if (!displayFreqCombo.getSelectedItem().equals(displayFreq)) {
            // Cannot find saved frequency in available frequencies.
            // Choose the closest one to 60 Hz.
            displayFreqCombo.setSelectedItem(getBestFrequency(resolution, modes));
        }
    }
<code>updateDisplayChoices</code> updates the available color depth and
display frequency options to match the currently selected resolution.
jme3-awt-dialogs/src/main/java/com/jme3/awt/AWTSettingsDialog.java