本文整理汇总了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));
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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 ();
}
示例9: mouseExited
import java.awt.Component; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e) {
Component comp = (Component)e.getSource();
comp.setCursor(Cursor.getDefaultCursor());
}
示例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));
}
示例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());
}