How to make the shadow of a Popupmenu perfectly match the rounded corners

I set the menu background to transparent in the drawPopupMenuBackground method of the LOOKANDFEEL class and drew a rounded rectangle as the menu background.

However, I found that the Popupmenu shadow at 4 corners is right angle, not rounded.

How can I solve this problem?