本文整理汇总了Java中javax.swing.JComponent.setCursor方法的典型用法代码示例。如果您正苦于以下问题:Java JComponent.setCursor方法的具体用法?Java JComponent.setCursor怎么用?Java JComponent.setCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.setCursor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseMoved
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public boolean mouseMoved(Point p, JComponent component) {
if (bounds != null && bounds.contains(p)) {
component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
int i = item.getNextFilesToShowCount();
String tooltip;
if (i > 0) {
tooltip = NbBundle.getMessage(SummaryCellRenderer.class, "MSG_ShowMoreFiles", i); //NOI18N
} else {
tooltip = NbBundle.getMessage(SummaryCellRenderer.class, "MSG_ShowAllFiles"); //NOI18N
}
component.setToolTipText(tooltip);
return true;
}
return false;
}
示例2: testProgressCursor
import javax.swing.JComponent; //导入方法依赖的package包/类
public void testProgressCursor () {
JComponent testTc = new ProgressCursorComp();
Cursor progressCursor = Utilities.createProgressCursor(testTc);
testTc.setCursor(progressCursor);
//testTc.open();
Cursor compCursor = testTc.getCursor();
if (!progressCursor.equals(compCursor)) {
fail("Setting of progress cursor don't work: \n" +
"Comp cursor: " + compCursor + "\n" +
"Progress cursor: " + progressCursor);
}
}
示例3: mouseMoved
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public boolean mouseMoved (Point p, JComponent component) {
if (bounds != null && bounds.contains(p)) {
component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
component.setToolTipText(Bundle.CTL_AnnotationBar_action_showCommit(revision));
return true;
}
return false;
}
示例4: mouseMoved
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public boolean mouseMoved(Point p, JComponent component) {
for (int i = 0; i < start.length; i++) {
if (bounds != null && bounds[i] != null && bounds[i].contains(p)) {
component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return true;
}
}
return false;
}
示例5: beginInteractiveRotate
import javax.swing.JComponent; //导入方法依赖的package包/类
public void beginInteractiveRotate() {
startPosition = getPosition();
startMap = getMap();
startMap.pushMouseListener(this);
startMap.addDrawComponent(this);
final JComponent view = startMap.getView();
view.addMouseMotionListener(this);
view.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
startMap.disableKeyListeners();
pivot = getPosition();
}
示例6: setCursor
import javax.swing.JComponent; //导入方法依赖的package包/类
public void setCursor(Cursor cursor) {
super.setCursor(cursor);
JComponent table = lastTable != null ? lastTable.get() : null;
if (table != null) table.setCursor(cursor);
}
示例7: mouseEntered
import javax.swing.JComponent; //导入方法依赖的package包/类
public void mouseEntered( MouseEvent e ) {
JComponent c = (JComponent) e.getSource();
c.setCursor( cursor );
}
示例8: mouseExited
import javax.swing.JComponent; //导入方法依赖的package包/类
public void mouseExited( MouseEvent e ) {
JComponent c = (JComponent) e.getSource();
c.setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
}