gpt4 book ai didi

java - GXT : destroying Dialogbox didn't work

转载 作者:行者123 更新时间:2023-12-01 13:24:00 30 4
gpt4 key购买 nike

我有一个对话框类:

public class Dialogbox {

public static final Window dialogbox = new Window();

public Dialogbox() {
dialogbox.setAnimateMinimize(true);

dialogbox.setWidth(469);
dialogbox.setHeight(487);
dialogbox.setShowMinimizeButton(true);
dialogbox.setAutoSize(true);
dialogbox.setCanDragReposition(true);
dialogbox.setCanDragResize(true);
dialogbox.setIsModal(true);
// dialogbox.setShowModalMask(true);
dialogbox.addCloseClickHandler(new CloseClickHandler() {
@Override
public void onCloseClick(CloseClientEvent event) {
// TODO Auto-generated method stub
dialogbox.destroy();
}
});

}

public void show(Widget name, String txt) {
dialogbox.setTitle(txt);
dialogbox.addItem(name);
dialogbox.setPadding(10);
AnimationCallback callback = null;
dialogbox.animateMove(400, 100, callback, 1000);


dialogbox.show();

}

当我尝试复合时:

f list = new f();
dia.show(f, "price");

我收到错误:

[ERROR] 15:34:20.020:WARN:Canvas:isc_WidgetCanvas_1:Attempt to access destroyed widget in the DOM - destroy() called at invalid time (eg: mid-draw) or invalid method called on destroy()d widget. Stack Trace:

我的内置合成器是一个小部件:

    Canvas canvas = new Canvas();
canvas.addChild(btnNewButton);
initWidget(canvas);

为什么我不能销毁我的对话框?我必须先删除该小部件吗?

最佳答案

是的,如果您只想隐藏对话框,那么你可以使用 dialogbox.hide()如果您想删除对话框,然后您可以使用

将其从父元素中分离/删除
dialogbox.removeFromParent()

但是,正如我所期望的,您只想隐藏对话框。

这里我给出了两种方式,大家可以根据自己的需求来使用。

关于java - GXT : destroying Dialogbox didn't work,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21883949/

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