I’m using a JList as part of a wizard to display all the steps to be performed (it also allows clicking on a step to go to it). Some steps will not always be needed, based on what’s done in previous steps. It’s these inapplicable steps I’d like to disable in the list.
How can I go about disabling (preventing the selection of) certain items in the list? Is there a better way than subclassing JList and overriding every selection-related method?
you have to implements DefaultListSelectionModel, then you can set the Flag if isEnabled or not
simple example