Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当 SWT 控件的首选大小发生变化时,使组件层次结构重新布局的最佳方法是什么? 我的特殊情况是标签文本的动态更新。
我知道的唯一方法,由 bokowski 建议作为对上一个问题ancestor的回答,是将组件层次结构向上移动到带有滚动条的 Composite ,然后调用ancestor.layout(new Control[] { changedDescendent }). 有一个更好的方法吗?最好对更改的控件或其父级进行简单的方法调用。
ancestor
ancestor.layout(new Control[] { changedDescendent })