gpt4 book ai didi

java - 更新 Swixml2 中的绑定(bind)

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:24:52 25 4
gpt4 key购买 nike

我在 SwiXml 中定义了一个对话框与对话框的相应 bean 上的属性绑定(bind)的 xml。

:
<label text="Project Files Location"/>
<textfield id="tfProjectLocation" bindWith="projectLocation"/>
<button label="Browse" action="actionBrowse"/>
:

当我从 bean 中更新属性的值时(例如使用操作),UI 不会更新为新值。

最佳答案

想通了。我需要将 PropertyChangEvent 分派(dispatch)给 bean 上的 PropertyChangeListener

projectLocation = fc.getSelectedFile().getPath();
PropertyChangeEvent pce = new PropertyChangeEvent(this,
"projectLocation", projectLocation, fc.getSelectedFile().getPath());
PropertyChangeListener[] p = getPropertyChangeListeners();
p[0].propertyChange(pce);

关于java - 更新 Swixml2 中的绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7331373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com