Example usage for javafx.scene.control Label setScaleX

List of usage examples for javafx.scene.control Label setScaleX

Introduction

In this page you can find the example usage for javafx.scene.control Label setScaleX.

Prototype

public final void setScaleX(double value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Label Sample");
    stage.setWidth(400);/*from w  w  w .j av a  2 s. c o  m*/
    stage.setHeight(180);

    HBox hbox = new HBox();

    final Label label1 = new Label("Search long long long long long long long long long ");
    label1.setOnMouseEntered(new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent e) {
            label1.setScaleX(1.5);
            label1.setScaleY(1.5);
        }
    });

    label1.setOnMouseExited(new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent e) {
            label1.setScaleX(1);
            label1.setScaleY(1);
        }
    });

    hbox.setSpacing(10);
    hbox.getChildren().add((label1));
    ((Group) scene.getRoot()).getChildren().add(hbox);

    stage.setScene(scene);
    stage.show();
}