WARNING: javafx.scene.Node impl_cssSet Failed to set css [StyleableProperty {owningClass: javafx.scene.layout.TilePane, fieldName: prefColumns, property: -fx-pref-columns, converter: SizeConverter, initialValue: '5', inherits: false, subProperties: []}]
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
at javafx.scene.layout.TilePane.impl_cssSet(TilePane.java:930)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.TilePane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override public void start(Stage stage) throws Exception {
TilePane tilePane = new TilePane();
tilePane.setStyle("-fx-pref-columns: 3; -fx-pref-rows: 2;");
Button btns[] = new Button[6];
for (int i=0; i<6; i++) {
btns[i] = new Button(Integer.toString(i));
btns[i].setStyle("-fx-padding: 20;");
tilePane.getChildren().add(btns[i]);
}
stage.setScene(new Scene(tilePane));
stage.show();
}
}
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
at javafx.scene.layout.TilePane.impl_cssSet(TilePane.java:930)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.TilePane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override public void start(Stage stage) throws Exception {
TilePane tilePane = new TilePane();
tilePane.setStyle("-fx-pref-columns: 3; -fx-pref-rows: 2;");
Button btns[] = new Button[6];
for (int i=0; i<6; i++) {
btns[i] = new Button(Integer.toString(i));
btns[i].setStyle("-fx-padding: 20;");
tilePane.getChildren().add(btns[i]);
}
stage.setScene(new Scene(tilePane));
stage.show();
}
}