在控件上添加JPopupMenu弹出菜单为什么只能在控件的边缘显示!!??
我在控件上添加了一个右键弹出菜单,发现弹不出来,只有在控件的边缘右击时才显示!!很郁闷,为什么?!?!!!!困扰我很久,求指导!!
label=new Label("test");
label.addMouseListener(this);
public void mouseReleased(MouseEvent e)
{
popMenu.show(e.getComponent(), e.getX(), e.getY());
}