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


Java Label.setCursor方法代码示例

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


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

示例1: createBox

import javafx.scene.control.Label; //导入方法依赖的package包/类
private Node createBox(Cursor cursor) {
    Label label = new Label(cursor.toString());
    label.setAlignment(Pos.CENTER);
    label.setPrefSize(85, 85);
    label.setStyle("-fx-border-color: #aaaaaa; -fx-background-color: #dddddd;");
    label.setCursor(cursor);
    return label;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:CursorSample.java

示例2: apply

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Node apply(int idx) {
    Val<String> formatted = paragraphs.map(n -> format(idx + 1, n));
    Label lineNo = new Label();
    lineNo.setCursor(Cursor.HAND);
    lineNo.setBackground(DEFAULT_BACKGROUND);
    lineNo.setPadding(DEFAULT_INSETS);
    lineNo.getStyleClass().add("lineno");
    lineNo.textProperty().bind(formatted.conditionOnShowing(lineNo));
    return lineNo;
}
 
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:12,代码来源:LineNumberFunction.java

示例3: homeView

import javafx.scene.control.Label; //导入方法依赖的package包/类
public static Scene homeView(){

        BorderPane view = new BorderPane();

        Label title = new Label("Classroom Flipkart");
        title.setFont(new Font("Open Sans", 60));
        title.setTextFill(Color.web("#ededed"));

        HBox header = new HBox(25);
        header.setMinHeight(30);
        header.setAlignment(Pos.TOP_CENTER);

        Label login = new Label("Login");
        login.setPadding(new Insets(5));
        login.setFont(new Font("Open Sans", 20));
        login.setTextFill(Color.web("#ededed"));
        login.setCursor(Cursor.HAND);
        login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");

        Label register = new Label("Register");
        register.setPadding(new Insets(5));
        register.setFont(new Font("Open Sans", 20));
        register.setTextFill(Color.web("#ededed"));
        register.setCursor(Cursor.HAND);

        header.getChildren().addAll(login, register);

        userLogin loginObject = new userLogin();
        userSignUp signUpObject = new userSignUp();

        BorderPane credential = new BorderPane(loginObject.userLogin(), header, null, null, null);
        credential.setMaxWidth(350);
        credential.setStyle("-fx-background-color: rgba(0, 100, 100, 0.5); -fx-border-color: grey; -fx-border-width: 1 1 1 1;");

        login.setOnMouseClicked(e->{
            credential.setCenter(loginObject.userLogin());
            login.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
            register.setStyle("");
        });

        register.setOnMouseClicked(e->{
            credential.setCenter(signUpObject.userSignUp());
            login.setStyle("");
            register.setStyle(" -fx-border-color: red; -fx-border-width: 0 0 3 0; -fx-border-insets: 0 0 1 0; ");
        });

        VBox centerVB = new VBox(30);
        centerVB.setAlignment(Pos.CENTER);
        centerVB.getChildren().addAll(title, credential);

        view.setCenter(centerVB);

        Scene scene = new Scene(view,800,500);
        scene.getStylesheets().add(loginHome.class.getResource("../../resources/css/main.css").toExternalForm());

        image = loginHome.class.getResource("../../resources/images/splash.jpg").toExternalForm();
        view.setStyle("-fx-background-image: url('" + image + "'); " +
                "-fx-background-position: center center; " +
                "-fx-background-size: cover, auto; " +
                "-fx-background-repeat: stretch;");

        return  scene;
    }
 
开发者ID:madHEYsia,项目名称:ClassroomFlipkart,代码行数:64,代码来源:loginHome.java


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