• javafx Cursor


    public class EffectTest extends Application {
      ObservableList cursors = FXCollections.observableArrayList(
          Cursor.DEFAULT,
          Cursor.CROSSHAIR,
          Cursor.WAIT,
          Cursor.TEXT,
          Cursor.HAND,
          Cursor.MOVE,
          Cursor.N_RESIZE,
          Cursor.NE_RESIZE,
          Cursor.E_RESIZE,
          Cursor.SE_RESIZE,
          Cursor.S_RESIZE,
          Cursor.SW_RESIZE,
          Cursor.W_RESIZE,
          Cursor.NW_RESIZE,
          Cursor.NONE
        ); 
        @Override
        public void start(Stage stage) {
          ChoiceBox choiceBoxRef = ChoiceBoxBuilder.create()
              .items(cursors)
              .build();
              
            VBox box = new VBox();
            box.getChildren().add(choiceBoxRef);
            final Scene scene = new Scene(box,300, 250);
            scene.setFill(null);
            stage.setScene(scene);
            stage.show();
            scene.cursorProperty().bind(choiceBoxRef.getSelectionModel()
                .selectedItemProperty());
            
        }
    
        public static void main(String[] args) {
            launch(args);
        }

     Image as cursor

    public class EffectTest extends Application {
          @Override
        public void start(Stage stage) {
            stage.setTitle("HTML");
            stage.setWidth(500);
            stage.setHeight(500);
            Scene scene = new Scene(new Group());
           
            Image image = new Image(EffectTest.class.getResourceAsStream("/effecttest/img/1156909.png"));
    
            scene.setCursor(new ImageCursor(image,
                                            image.getWidth() / 10,
                                            image.getHeight() /10));
    
     
            stage.setScene(scene);
            stage.show();
        }
     
        
        
    }
  • 相关阅读:
    人月神话
    Rails 最佳实践
    萧伯纳名言名句大全
    听话,照做,执行,别发挥
    So Good They Can't Ignore You
    谈谈遵守公司作战纪律
    如何让自己有动力去长久地做一件事情
    新架构优化问题总结
    Markdown 入门
    关于代码版本管理的思考和建议
  • 原文地址:https://www.cnblogs.com/rojas/p/4720565.html
Copyright © 2020-2023  润新知