I have a JComboBox filled with some random items, that can change at run time. I have set them as JLabels using getListCellRendererComponent(…). I have also set some of those Jlabels as setEnabled( false ).
When user selects an item from that JComboBox, is there a way i can detect if it is enabled or disabled ?
The renederer just paints them so there will not be an isEnabled value to check. Instead use the same logic that the cellRenderer uses to determine if a value is allowed, when you are looking at the selection. Or possibly remove those values from the list instead of making the disabled.