-
Bug
-
Resolution: Fixed
-
P4
-
8
-
b116
TextAlignment.CENTER used to work in b99
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
public class App extends Application {
private static final String TITLE = "First line first line\nSecond line\nThird line third line";
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Button b1 = new Button(TITLE);
b1.setTextAlignment(TextAlignment.LEFT);
Button b2 = new Button(TITLE);
b2.setTextAlignment(TextAlignment.CENTER);
setSize(b1);
setSize(b2);
HBox root = new HBox(4);
root.getChildren().addAll(b1, b2);
Scene scene = new Scene(root, 404, 300);
stage.setScene(scene);
stage.show();
}
private void setSize(Button b) {
b.setMinWidth(200);
}
}
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
public class App extends Application {
private static final String TITLE = "First line first line\nSecond line\nThird line third line";
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Button b1 = new Button(TITLE);
b1.setTextAlignment(TextAlignment.LEFT);
Button b2 = new Button(TITLE);
b2.setTextAlignment(TextAlignment.CENTER);
setSize(b1);
setSize(b2);
HBox root = new HBox(4);
root.getChildren().addAll(b1, b2);
Scene scene = new Scene(root, 404, 300);
stage.setScene(scene);
stage.show();
}
private void setSize(Button b) {
b.setMinWidth(200);
}
}