变量源名称的java自定义事件处理
我正在创建一个带有子菜单的菜单,我想在列表中显示客户端。现在,客户机被添加到显示其名字和姓氏的子菜单中
menuItemNames.add(((Person)model.get(i)).getfName() + " "+ ((Person)model.get(i)).getlName());
for (int x=0; x<menuItemNames.size();x++){
JMenuItem item = new JMenuItem(menuItemNames.get(x).toString());
item.addActionListener(this);
listItemSearchName.add(item);
}
listItemSearchName
是添加该项的菜单
在我的actionPerformed
方法中,我希望能够知道listItemSearchName
菜单中的内容何时被点击
共 (0) 个答案