Java Code Examples for javafx.scene.control.Label#setCursor()

The following examples show how to use javafx.scene.control.Label#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: DonateDialog.java    From Animu-Downloaderu with MIT License 5 votes vote down vote up
public DonateDialog() {
	var buttonType = new ButtonType("Yes", ButtonData.YES);
	var dialogPane = getDialogPane();

	setTitle("Donate :3");
	dialogPane.getStylesheets().add(getClass().getResource("/css/combo.css").toExternalForm());

	var gridPane = new GridPane();

	gridPane.setVgap(10);
	String question = "Thank you for clicking the donate button!! <3\n\n"
			+ "You can donate via liberapay, paypal, or help me by subscribing to my patreon!\n\n";

	Label librapay = new Label("Liberapay");
	Label paypal = new Label("Paypal");
	Label patrion = new Label("Patreon");
	HBox donateButtons = new HBox(15);
	donateButtons.setAlignment(Pos.CENTER);
	librapay.setCursor(Cursor.HAND);
	paypal.setCursor(Cursor.HAND);
	patrion.setCursor(Cursor.HAND);
	librapay.setId("link");
	paypal.setId("link");
	patrion.setId("link");

	librapay.setOnMouseClicked(e -> handleClick("https://liberapay.com/codingotaku/donate"));
	paypal.setOnMouseClicked(e -> handleClick("https://paypal.me/codingotaku"));
	patrion.setOnMouseClicked(e -> handleClick("https://www.patreon.com/bePatron?u=13678963"));
	donateButtons.getChildren().addAll(librapay, paypal, patrion);

	dialogPane.getButtonTypes().addAll(ButtonType.CLOSE);

	var label = new Label(question);
	GridPane.setConstraints(label, 1, 2);
	GridPane.setConstraints(donateButtons, 1, 3, 2, 1);
	gridPane.getChildren().addAll(label, donateButtons);
	dialogPane.setContent(gridPane);
	setResultConverter(dialogButton -> dialogButton == buttonType);
}
 
Example 2
Source File: CursorSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: CursorSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
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;
}