你是正确的,没有
getSource()像其他一些听众,但你可以使用文档类的
putProperty(),并
getProperty()达到你在找什么。
你可以做
JTextField jTextField = new JTextField("Text 1");jTextField.getdocument().putProperty("parent", jTextField);和
稍后在documentListener的事件中,您可以像这样获取父对象
JTextField textField = (JTextField) e.getdocument().getProperty("parent");e在哪里
documentEvent



