本文整理汇总了Java中javax.swing.JTable.addMouseMotionListener方法的典型用法代码示例。如果您正苦于以下问题:Java JTable.addMouseMotionListener方法的具体用法?Java JTable.addMouseMotionListener怎么用?Java JTable.addMouseMotionListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTable
的用法示例。
在下文中一共展示了JTable.addMouseMotionListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: install
import javax.swing.JTable; //导入方法依赖的package包/类
public static void install(JTable table) {
TableCellDrag tcellDrag = new TableCellDrag();
table.addMouseListener(tcellDrag);
table.addMouseMotionListener(tcellDrag);
}
示例2: displayExtendedCells
import javax.swing.JTable; //导入方法依赖的package包/类
/**
* Enhances a JTable, so it displays tooltips for cells which are cut
* at the right side.
* This feature is useful for tables with no horizontal scrollbar, since
* the user may see full cell's contents when hovering above the row/cell.
* <p/>
* A tooltip is displayed above table, which hides itself whenever the user
* moves mouse out of component or the tooltip or starts editing (if the table
* is cell-editable).
* <p/>
* The tooltip's contents is painted by the configured CellRenderer.
*
* @param table table to enhance
* @return the table; just use as part of new expression.
*/
public static JTable displayExtendedCells(JTable table) {
CellExtensionSupport supp = new CellExtensionSupport(table);
table.addMouseListener(supp);
table.addMouseMotionListener(supp);
table.getSelectionModel().addListSelectionListener(supp);
return table;
}