views:

43

answers:

2

Is there a published list of property names for Swing components?

From looking at the source code for javax.swing.table.TableColumn, I can find calls to firePropertyChange with property names like "modelIndex", "identifier", "headerValue", etc. as hardcoded Strings, not as String constants. As far as I can tell, the only way to know what properties this class can "fire" is to look at the source code. Writing an event listener on this basis is very troubling, for obvious reasons.

If there is no published list, is there a better way to get the property names?

Thanks.

A: 

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/table/TableColumn.html

Mchl
@Mchl: And where on this page is the list of properties?
Ralph
Isn't it in 'Field summary'? It might not be, I've not much experience with Swing actually.
Mchl
+2  A: 

The only way to find out for sure is to interrogate PropertyDescriptors on corresponding BeanInfo class. PropertyDescriptor has isBound method.

It should be fairly trivial to write the code using Bean Introspection API. This code may simply dump all the bounded properties for a class

eugener
@eugener: That's exactly what I needed. Thanks.
Ralph