日期:2014-05-19 浏览次数:20741 次
JMenuItem menu1 = new JMenuItem( "Delete")); JMenuItem menu2 = new JMenuItem( "Add")); JPopupMenu2.add(menu1); JPopupMenu2.add(menu2); menu1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //delete处理 } }); menu2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //add处理 } });