Disabling component

Good morning every body

i want to disable a DialogComponentNumber while i select DialogComponentNumber in the execute method of the NodeModel class. I used setEnabled but it could not be grayed-out.

What can i do please



Hi Nadia,

don't use setEnabled from the DialogComponent, but from the SettingsModel.  See this snippet:

        final SettingsModelIntegerBounded nofResults =
        DialogComponentNumber nofResultsComponent = new DialogComponentNumber(
                nofResults, "Max. number of results", 100);

        final SettingsModelDoubleBounded totalDiversity =
        addDialogComponent(new DialogComponentNumber(
                totalDiversity, "Total diversity", 0.01));

        nofResults.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                totalDiversity.setEnabled(nofResults.getIntValue() <= 500);

This will disable the DialogComponentNumber for total diversity, if the DialogComponentNumber for number of results is set to something higher than 500.

Best, Frank

Good morning ,

Thanks for your response, it helped me and it works well.

Thank you.