Tag: onmouseover

JTable与JPopupMenu

我怎样才能防止触发和显示JPopupMenu只有当Mouse Cursor在选定JTable'Row 我的问题:如果有另一种方式作为getBounds从选定的行,并确定/比较与Mouse位置… 我简单的sscce展示了不需要的相反的状态,任何行都可以被选中, JPopupMenu从整个JTable被触发 import java.awt.event.*; import javax.swing.*; import javax.swing.table.*; public class TableCheckBox extends JFrame { private static final long serialVersionUID = 1L; private JTable table; public TableCheckBox() { Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"}; Object[][] data = { {"Buy", "IBM", new Integer(1000), new Double(80.50), false}, {"Sell", "MicroSoft", new Integer(2000), new Double(6.25), […]