开发者

Removing a component from another component

开发者 https://www.devze.com 2023-04-11 00:14 出处:网络
This little problem has been driving me insane. My main screen contains 2 custom components; let\'s call them \"A\" and \"B\" for t开发者_Python百科he sake of simplicity. Within component A I have a b

This little problem has been driving me insane. My main screen contains 2 custom components; let's call them "A" and "B" for t开发者_Python百科he sake of simplicity. Within component A I have a button with which I would like to remove/replace component B.

To do this I am calling a reference of component B that I have in the main screen class. I then call the removeComponent(componentBReference) method of the layout which contains component B. Unfortunately this does absolutely nothing. I've also tried requestRepaint() after the method call and the replaceComponent() method. Not even mainScreenReference.myLayout.setVisible(false) works.

What am I doing wrong or what must I consider?


First of all try to set for all your components immediate mode by calling this method setImmediate(true).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号