Exception in thread "AWT-EventQueue-2" java.lang.IllegalArgumentException: origin not in parent's hi

Discussion in 'Java' started by bing@helpstar.com, Jun 19, 2007.

  1. Guest

    I have a java applet running well until IE7 came up.

    If user upgrade broswer to IE7 then the error comes in Java Console.

    Exception in thread "AWT-EventQueue-2"
    java.lang.IllegalArgumentException: origin not in parent's hierarchy
    at java.awt.PopupMenu.show(Unknown Source)
    at MenuPanel.update(MenuPanel.java:131)
    at MenuPanel.paint(MenuPanel.java:102)
    at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    at java.awt.Container.paint(Unknown Source)
    at java.awt.Container.update(Unknown Source)
    at sun.awt.RepaintArea.updateComponent(Unknown Source)
    at sun.awt.RepaintArea.paint(Unknown Source)
    at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


    Here is a part of code for the Applet:

    PopupMenu popList[];
    Label lblList[];

    public void update(Graphics g)
    {
    Rectangle rect = getBounds();
    g.setColor(clrDefault);

    g.fillRect(0, 0, rect.width, rect.height);
    g.draw3DRect(rect.x+3,rect.y+3, 2,rect.height-9, true);
    g.draw3DRect(rect.x+6,rect.y+3, 2,rect.height-9, true);

    for (int i = 0; i < lblList.length; i++)
    {
    rect = lblList.getBounds();
    if (i == idxHighlight)
    g.draw3DRect(rect.x-1,rect.y-1, rect.width+2,rect.height+2, true);
    if (i == idxPressed)
    {

    g.draw3DRect(rect.x-1,rect.y-1, rect.width+2,rect.height+2, false);

    if (bMenuUp == false)
    {
    bMenuUp = true;
    if (bolDisplayImage && imageX > 0) {
    g.drawImage(imageLine, imageX, imageY+2, this);
    g.drawImage(imageSetup1, imageX+10, imageY, this);
    }
    popList.show(this, rect.x, rect.y+rect.height+1);
    }
    }
    }

    if (bolDisplayImage) {
    imageX = rect.x + rect.width+2;
    imageY = rect.y;
    g.drawImage(imageLine, imageX, imageY+2, this);
    if (bolOnMouseOver) {
    g.drawImage(imageSetup2, imageX+10, imageY, this);
    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else {
    g.drawImage(imageSetup1, imageX+10, imageY, this);
    setCursor(Cursor.getDefaultCursor());
    }
    }
    }


    someone please help?

    Thanks
    , Jun 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page