Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Internet Explorer / General Topics / June 2007

Tip: Looking for answers? Try searching our database.

Exception in thread "AWT-EventQueue-2"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bing@helpstar.com - 20 Jun 2007 15:20 GMT
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[i].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[i].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
bing@helpstar.com - 21 Jun 2007 15:42 GMT
I fixed the problem by changing the line:
popList[i].show(this, rect.x, rect.y+rect.height+1);
to:
popList[i].show(lblList[i]. 0, rect.y+rect.height+1);

Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.