當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。