标签:
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") } } }
标签:
原文地址:http://www.cnblogs.com/bergus/p/4423671.html