i need to write a facade-class which gets the most appropiate value of a component and converts it to a string representation. e.g. the text of a Label, the state of a CheckBox or the index of a Radiobutton-Selection.
Therefore I determined the type of component via AccessibleContext.getRole(). Then I want to call the suitable getter. So if i know its a JLabel i wanna call a method like getText(), but not the specific one of the JLabel, but from an Accessible Interface. The only thing I found was the AccessibleText.getAccessibleText().getSelectedText(), but it seems, that a JLabel does not implement AccessibleText (NullpointerException). This is similar to other Accessible-Interfaces, i can’t see the appropriate getters …