Search code examples
javaswingcanvasawtjpopupmenu

JPopupMenu display under Canvas


I have a Canvas, some text fields and a context menu.

When I start the application and right click on the canvas a popup menu shows. But when I write something inside the text field than I right click on the canvas, the popup will shows behind the canvas.

Any idea how to fix that ?


Solution

  • JPopupMenu.setDefaultLightWeightPopupEnabled( false );
    

    solved the issue.