-
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
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks