假设我使用 SwingBuilder 声明一个对象,如下所示:
swing.button(id:'something')
我知道我可以Component
通过调用 SwingBuilder 获得支持:
swing."something"
但是我怎样才能从 , 的实例Component
返回到它id
的字符串呢?
Component c = getMyButton()
String whatIWant = c.id //Property doesn't exist
String attempt2 = c['id'] //Property doesn't exist