import groovy.swing.*
import javax.swing.*
import java.awt.*
def swing = new SwingBuilder()
swing.frame(title:"hello",show:true){
panel(){
def mm=swing.textField(text:"bcxhdbhd")
mm.mousePressed={e->
def popupMenu=swing.popupMenu(){
menuItem(text:"bhdfyhefyh")
}
popupMenu.show(e.getComponent(),e.getX(),e.getY())
//这里的e.getComponent()换成mm也一样
println("jjjj")
mm.setText("kkkkkk")
}
}
}