ProgressIndicatorの下にある割合のテキストを削除しようとしましたが、失敗しました。私は割合フォントを変更することができていますので、私は、ロードされているこのの言及いくつか発見され、受け入れられた答えをしようとしたが、それは、Java 8にアップデート121JavaFX:ProgressIndicatorの割合を削除します
私はCSSを知ってpackage com.company.mytest;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ProgressApp extends Application {
public static void main(String[] args) {
launch(args);
}
/* (non-Javadoc)
* @see javafx.application.Application#start(javafx.stage.Stage)
*/
@Override
public void start(Stage stage) throws Exception {
ProgressIndicator progress = new ProgressIndicator();
progress.setProgress(0.5f);
StackPane root = new StackPane();
root.getChildren().add(progress);
Scene scene = new Scene(root);
scene.getStylesheets()
.add(getClass().getResource("progress.css").toExternalForm());
stage.setScene(scene);
stage.setWidth(300);
stage.setHeight(300);
stage.setTitle("JavaFX 8 app");
stage.show();
}
}
を使用して
動作しないいますサイズ。これはprogress.cssファイルのCSSコンテンツです。 null
に-fx-fill
属性を設定
.progress-indicator .percentage {
visibility: hidden;
}
はい、それはまだスペースを占有。フォントサイズを非常に小さく設定しても、パーセンテージは使用するスペースよりも多くのスペースを占有します。 – DJViking
はい、そうです。更新された回答を確認してください。 – DVarga
パディングを設定することはやりました。しかし、ボトムパッディングのためにハードコードされた負の値を設定することは理想的ではありませパフォーマンスに付加的なオーバーヘッドがない場合は、プログラマチックソリューションを使用するほうがよいでしょう。 – DJViking