Java Cursor .getSystemCustomCursor (String name)

Syntax

Cursor.getSystemCustomCursor(String name) has the following syntax.

public static Cursor getSystemCustomCursor(String name)     throws AWTException ,      HeadlessException

Example

In the following code shows how to use Cursor.getSystemCustomCursor(String name) method.


//from   w  w w. ja  v  a2 s  . com
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Cursor;
import java.awt.Frame;
import java.awt.HeadlessException;

public class Main {
  public static void main(String[] args) throws HeadlessException, AWTException {
    Frame frame = new Frame();
    Button button1 = new Button("Ok");
    frame.add(button1, BorderLayout.NORTH);
    frame.setSize(50, 55);
    frame.setVisible(true);
    
    button1.setCursor(Cursor.getSystemCustomCursor("MoveDrop.32x32"));
  }
}




















Home »
  Java Tutorial »
    java.awt »




BasicStroke
BorderLayout
CardLayout
Color
Cursor
Desktop
DesktopManager
DisplayMode
EventQueue
FlowLayout
FocusTraversalPolicy
Font
FontMetrics
GradientPaint
Graphics
Graphics2D
GraphicsConfiguration
GraphicsDevice
GraphicsEnvironment
GridBagConstraints
GridBagLayout
GridLayout
Image
ItemSelectable
KeyboardFocusManager
LayoutManager
LayoutManager2
Point
Rectangle
Robot
Shape
SplashScreen
SystemColor
SystemTray
TexturePaint
TrayIcon
Toolkit
Transparency