system.gui.createPopupMenu

I am using this function a first time and testing over a onMousePress event of a power table as below,

but it doesn’t seem to be generating any pupup. Also, when I print menu, it prints below in console

com.inductiveautomation.factorypmi.application.script.builtin.WindowUtilities$JyPopupMenu[,0,0,0x0,invalid,layout=javax.swing.plaf.synth.SynthMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@3628f758,flags=16777216,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]

Any help is appreciated on how to create this popup.

Thanks

This only works, as you’ve got it, with a right click action. If you want it to work for left click, you need to pass the x and y coords to the show function which you should be able to get from the event object (event.x from memory)

1 Like

@nminchin thanks