popup menu appears behind images


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: popup menu appears behind images

  1. #1
    Join Date
    Mar 2003
    Posts
    1

    Question popup menu appears behind images

    I'm building a project that displays images on the screen, when the user right clicks on them, a popup menu pops up.

    The problem is that the popup menu appears behind the images. Anyone know why?

    Some snippets of code:

    //in MousePressed() function

    objectPopup.show(this,x,y);

    //in paint() function

    g2.drawImage(myGraphics.capitalImage,
    object[j].position.x-15,object[j].position.y-15,
    imageSize, imageSize, null,this);


    I've tried using the glass pane, but couldn't get that to work, and I also set the popup menu to be heavyweight, which did make the popup menu appear above the images, but the submenus were still below, and also it couldn't detect when I clicked on a menu item.

    Thanks in advance for any help

  2. #2
    Join Date
    Nov 2002
    Posts
    59
    Be sure to call super.paint() as the first line in your paint method...not sure if this will compeletely resolve it, but can help to resolve alot of other issues as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center