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


Java Component.setCursor方法代码示例

本文整理汇总了Java中java.awt.Component.setCursor方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setCursor方法的具体用法?Java Component.setCursor怎么用?Java Component.setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Component的用法示例。


在下文中一共展示了Component.setCursor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setWaitingState

import java.awt.Component; //导入方法依赖的package包/类
void setWaitingState (boolean waitingState) {
    boolean enabled = !waitingState;

    for (Component c : tpTabs.getComponents()) {
        if (c instanceof UnitTab) {
            ((UnitTab) c).setWaitingState (waitingState);
        }            
    }               
    
    // the Close & Help buttons are always enabled
    bClose.setEnabled (true);
    
    Component parent = getParent ();
    Component rootPane = getRootPane ();
    if (parent != null) {
        parent.setEnabled (enabled);
    }
    if (rootPane != null) {
        if (enabled) {
            rootPane.setCursor (null);
        } else {
            rootPane.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR));
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:PluginManagerUI.java

示例2: doShowWaitCursor

import java.awt.Component; //导入方法依赖的package包/类
private static void doShowWaitCursor (Component glassPane, boolean show) {
    if (show) {
        glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        glassPane.setVisible(true);
    } else {
        glassPane.setVisible(false);
        glassPane.setCursor(null);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:TreeView.java

示例3: run

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void run() {
    try {            
        JFrame f = (JFrame)WindowManager.getDefault ().getMainWindow ();
        Component c = f.getGlassPane ();
        c.setVisible ( show );
        c.setCursor (show ? Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR) : null);
    } 
    catch (NullPointerException npe) {
        Exceptions.printStackTrace(npe);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ProjectUtilities.java

示例4: setWaitingState

import java.awt.Component; //导入方法依赖的package包/类
public void setWaitingState(boolean wait) {
    Component rootPane = getRootPane();
    configPanel.setInputEnabled(!wait);
    testButton.setEnabled(!wait);
    if (rootPane != null) {
        rootPane.setCursor(wait ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DockerConnectionVisual.java

示例5: mouseMoved

import java.awt.Component; //导入方法依赖的package包/类
public void mouseMoved(MouseEvent e) {
    check(e);
    Component comp = (Component)e.getSource();
    movedBounds = comp.getBounds(movedBounds);

    cursorType = getCursorType(movedBounds, e.getPoint());
    comp.setCursor(Cursor.getPredefinedCursor(cursorType));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DecorationUtils.java

示例6: run

import java.awt.Component; //导入方法依赖的package包/类
public void run() {
    try {
        JFrame f = (JFrame) WindowManager.getDefault().getMainWindow();
        Component c = f.getGlassPane();
        c.setVisible(show);
        c.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    } catch (NullPointerException npe) {
        Exceptions.printStackTrace(npe);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:CustomizerProviderImpl.java

示例7: setWaitingState

import java.awt.Component; //导入方法依赖的package包/类
public void setWaitingState(boolean wait) {
    Component rootPane = getRootPane();
    enableInput(! wait);
    if (rootPane != null) {
        rootPane.setCursor(wait ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:NewConnectionPanel.java

示例8: setWaitingState

import java.awt.Component; //导入方法依赖的package包/类
void setWaitingState (boolean waitingState) {
    boolean enabled = !waitingState;
    Component[] all = getComponents ();
    for (Component component : all) {
        if (component == bTabAction || component == bDeactivate || component == bUninstall) {
            if (enabled) {
                TabAction a = (TabAction) ((AbstractButton)component).getAction();
                component.setEnabled (a == null ? false : a.isEnabled());
            } else {
                component.setEnabled (enabled);
            }
        } else {
            if (component == spTab) {
                spTab.getLeftComponent ().setEnabled (enabled);
                spTab.getRightComponent ().setEnabled (enabled);
                details.setEnabled (enabled);
                table.setEnabled (enabled);
            } else {
                component.setEnabled (enabled);
            }
        }
    }
    if (reloadAction != null) {
        reloadAction.setEnabled (enabled);
    }
    Component parent = getParent ();
    Component rootPane = getRootPane ();
    if (parent != null) {
        parent.setEnabled (enabled);
    }
    if (rootPane != null) {
        if (enabled) {
            rootPane.setCursor (null);
        } else {
            rootPane.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR));
        }
    }
    focusTable ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:UnitTab.java

示例9: mouseExited

import java.awt.Component; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e) {
    Component comp = (Component)e.getSource();
    comp.setCursor(Cursor.getDefaultCursor());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:DecorationUtils.java

示例10: setHandCursor

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Sets the hand cursor.
 *
 * @param component
 * @param label
 */
private void setHandCursor(Component component, JLabel label) {
    component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-B,代码行数:11,代码来源:LabelMapListener.java

示例11: setDefaultCursor

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Sets the default cursor.
 *
 * @param component
 * @param label
 */
private void setDefaultCursor(Component component, JLabel label) {
    component.setCursor(Cursor.getDefaultCursor());
    label.setCursor(Cursor.getDefaultCursor());
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-B,代码行数:11,代码来源:LabelMapListener.java


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