当前位置: 首页>>代码示例>>Java>>正文


Java JComponent.setCursor方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:SummaryCellRenderer.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:UtilitiesProgressCursorTest.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:TooltipWindow.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:VCSHyperlinkSupport.java

示例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();
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:15,代码来源:FreeRotator.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:ProfilingPoint.java

示例7: mouseEntered

import javax.swing.JComponent; //导入方法依赖的package包/类
public void mouseEntered( MouseEvent e ) {
    JComponent c = (JComponent) e.getSource();
    c.setCursor( cursor );
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:5,代码来源:MapperPickingGraphMousePlugin.java

示例8: mouseExited

import javax.swing.JComponent; //导入方法依赖的package包/类
public void mouseExited( MouseEvent e ) {
    JComponent c = (JComponent) e.getSource();
    c.setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:5,代码来源:MapperPickingGraphMousePlugin.java


注:本文中的javax.swing.JComponent.setCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。