PopupPanel的问题 - gwt

时间:2010-02-06 21:53:26

标签: java gwt panel

我正在为我的项目使用PopupPanel和Gwt Canvas。这里当点击画布绘图区域时,popuppanel出现。在我的主类中,我有一个扩展PopupPanel的私有类,然后在onModuleLoad()中调用该面板。代码看起来像这样:

Button b = new Button("Circle");
        b.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent event) {
                DrawingArea d = new DrawingArea(40, 30);
                Circle c = new Circle(20, 15, 20);
                d.add(c);
                dragController.makeDraggable(d);
                dragController.setBehaviorDragStartSensitivity(1);
                boundaryPanel.add(d, 200, 200 );
                //Diagram dia = new Diagram(boundaryPanel);
               /* Shape s = new Shape(d);
                s.showOnDiagram(diagram);*/
                d.addClickHandler(new ClickHandler(){
                    @Override
                    public void onClick(ClickEvent event) {
                        System.out.println("ERD Circle");
                        Widget w = (Widget)event.getSource();
                        PopUpPanel pop = new PopUpPanel(w);
                        pop.setPopupPosition(w.getAbsoluteLeft() - 150, w.getAbsoluteTop());
                        pop.show();
                    }                   
                });
            }           
        });

这里PopUpPanel是扩展PopupPanel的那个。这里是PopUpPanel的代码:

private static class PopUpPanel extends PopupPanel{

    Button connect = new Button("Connect");
    Button delete = new Button("Delete");
    Button detail = new Button("Detail");

    public PopUpPanel(final Widget widget){
       super(true);
       VerticalPanel vp = new VerticalPanel();
       vp.add(connect);
       vp.add(delete);
       vp.add(detail);

       setWidget(vp);
    }
}

现在我遇到的问题是:

当我点击画布绘图区域时,PopupPanel会出现错误。以下是错误详细信息:

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Invalid class string


 number: -2147221005
 description: Invalid class string


    at com.google.gwt.user.client.ui.impl.PopupImplIE6.onShow(Native Method)
    at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.onInstantaneousRun(PopupPanel.java:257)
    at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.setState(PopupPanel.java:180)
    at com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:1189)
    at com.google.gwt.user.client.ui.PopupPanel.show(PopupPanel.java:794)
    at com.e.r.d.client.ERD1$4$1.onClick(ERD1.java:177)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:52)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:90)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
    at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)

任何输入都会有很大的帮助。

谢谢。

1 个答案:

答案 0 :(得分:1)

我得到了它的工作。这是由于缺少Microsoft JScript注册而发生的。一旦我注册“regsvr32 jscript.dll”它工作正常。感谢。