1
JavaFXでマーキーアニメーションに問題があります。私は3つのノードを持つHBoxを持っていて、2番目のノードにはテキストノードがありますが、それはマーキー変換が必要ですが、テキストが2番目のノードから出てきたら表示されません。JavaFXマーキーがノードから外に出る
画像を設定して問題を表示します(テキストは白い領域に表示されます)。
私のhboxコード:
HBox bill = new HBox(0);
bill.getChildren().addAll(logoPane,product,total);
bill.setBackground(new Background(new BackgroundFill(Color.web("#FFFFFF"), CornerRadii.EMPTY, Insets.EMPTY)));
bill.setHgrow(product, Priority.ALWAYS);
アニメーション:
timelineAnimation = new Timeline();
final KeyValue kv = new KeyValue(productLabel.translateXProperty(), -1000);
final KeyFrame kf = new KeyFrame(Duration.millis(2000), kv);
timelineAnimation.getKeyFrames().add(kf);
そして、どのように私は私の製品ノードを定義します。
productLabel.setFont(new Font("Times New Roman",30));
product = new StackPane();
product.setMaxWidth(2000);
product.setMaxHeight(100);
product.setMinWidth(574);
product.setMinHeight(100);
product.getChildren().add(productLabel);
product.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));
product.setAlignment(productLabel, Pos.CENTER);
が、それは十分にinformatたホープイオン。
ありがとうございます!
ニース、それは動作します!ありがとう@fabian – accnono