Java Swing - context menu

Mac OS X

Did any one used context menu’s in mac? I am having issues with mac os. Here is the problem,

I have textfield and a pop up menu, i want to show the popup menu as i type in textfield. The problem is as soon as pop up is visible it is grabbing the focus, to type in textfield i have to use mouse to select it.

I am programatically grabbing the focus for textfield after it shows pop up menu. Still my textfield is not getting focus.

Does anyone know about this problem? If so could you please let me know how you fixed it.