Java Code Examples for java.awt.Frame#setCursor()

The following examples show how to use java.awt.Frame#setCursor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiResolutionCursorTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 2
Source File: MultiResolutionCursorTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 3
Source File: MultiResolutionCursorTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 4
Source File: MultiResolutionCursorTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 5
Source File: MultiResolutionCursorTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 6
Source File: MultiResolutionCursorTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new BaseMultiResolutionImage(
            createResolutionVariant(0),
            createResolutionVariant(1),
            createResolutionVariant(2),
            createResolutionVariant(3)
    );

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 7
Source File: MultiResolutionCursorTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 8
Source File: MultiResolutionCursorTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 9
Source File: MultiResolutionCursorTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 10
Source File: MultiResolutionCursorTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}
 
Example 11
Source File: MultiResolutionCursorTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void start() {
    //Get things going.  Request focus, set size, et cetera
    setSize(200, 200);
    setVisible(true);
    validate();

    final Image image = new MultiResolutionCursor();

    int center = sizes[0] / 2;
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            image, new Point(center, center), "multi-resolution cursor");

    Frame frame = new Frame("Test Frame");
    frame.setSize(300, 300);
    frame.setLocation(300, 50);
    frame.add(new Label("Move cursor here"));
    frame.setCursor(cursor);
    frame.setVisible(true);
}