當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。