本文整理匯總了Java中javafx.scene.control.ProgressBar.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressBar.setVisible方法的具體用法?Java ProgressBar.setVisible怎麽用?Java ProgressBar.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setVisible方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addLabels
import javafx.scene.control.ProgressBar; //導入方法依賴的package包/類
private void addLabels() {
Label titleLabel = new Label(Res.get("dao.compensation.active.phase"));
Label startLabel = new Label(Res.get("dao.compensation.active.startBlock"));
AnchorPane startLabelPane = new AnchorPane();
AnchorPane.setLeftAnchor(startLabel, 0d);
startLabelPane.getChildren().add(startLabel);
Label endLabel = new Label(Res.get("dao.compensation.active.endBlock"));
AnchorPane endLabelPane = new AnchorPane();
AnchorPane.setRightAnchor(endLabel, 0d);
endLabelPane.getChildren().add(endLabel);
ProgressBar progressBar = new ProgressBar();
progressBar.setMinHeight(9);
progressBar.setMaxHeight(9);
progressBar.setVisible(false);
vBoxLabels = new VBox();
vBoxLabels.setSpacing(5);
vBoxLabels.getChildren().addAll(titleLabel, progressBar, startLabelPane, endLabelPane);
vBoxLabels.setAlignment(Pos.CENTER);
vBoxLabels.setPadding(new Insets(0, 10, 0, 0));
getChildren().add(vBoxLabels);
}
示例2: setupProgressBar
import javafx.scene.control.ProgressBar; //導入方法依賴的package包/類
private void setupProgressBar() {
final VBox vbox = new VBox();
final ProgressBar browserProgressBar = new ProgressBar();
browserProgressBar.setVisible(false);
browserProgressBar.setMinHeight(PROGRESS_BAR_MIN_HEIGHT);
browserProgressBar.setMaxWidth(Double.MAX_VALUE);
vbox.getChildren().add(browserProgressBar);
this.browserRootBorderPane.setBottom(vbox);
final DoubleProperty progress = new SimpleDoubleProperty();
TwitchBrowserUpdateService.activeServicesProperty().addListener((observable, oldValue, newValue) -> {
final int size = observable.getValue().size();
if (size == 0) {
progress.set(1.0D);
browserProgressBar.setVisible(false);
} else {
browserProgressBar.setVisible(true);
progress.set(1.0D / observable.getValue().size());
}
});
browserProgressBar.progressProperty().bind(progress);
}
示例3: createLoginScene
import javafx.scene.control.ProgressBar; //導入方法依賴的package包/類
private Scene createLoginScene() {
VBox vbox = new VBox();
userNameBox.setPromptText("Username");
vbox.getChildren().add(userNameBox);
passwordBox.setPromptText("Password");
vbox.getChildren().add(passwordBox);
vbox.disableProperty().bind(disableLoginBox);
button.setOnAction(new EventHandler<ActionEvent>(){
public void handle(ActionEvent t) {
// Save credentials
disableLoginBox.set(true);
checkLogin();
}
});
vbox.getChildren().add(button);
bar = new ProgressBar(0);
vbox.getChildren().add(bar);
bar.setVisible(false);
if (DEBUG) {
userNameBox.setText("slim");
passwordBox.setText("god1rifewo");
disableLoginBox.set(true);
checkLogin();
}
Scene sc = new Scene(vbox, 200, 200);
return sc;
}
示例4: BottomArea
import javafx.scene.control.ProgressBar; //導入方法依賴的package包/類
/** Constructor */
public BottomArea() {
textMessage = new Label();
progressBar = new ProgressBar(0);
progressBar.setVisible(false);
setLeft(textMessage);
setRight(progressBar);
}
示例5: build
import javafx.scene.control.ProgressBar; //導入方法依賴的package包/類
public void build() {
final VBox controls=new VBox();
controls.getStyleClass().add("blank");
final Button butt=new Button("Check for updates");
final LogPane logPane= new LogPane();
//logPane.setPadding(new Insets(15, 12, 15, 12));
final ProgressBar bar= new ProgressBar();
bar.setVisible(false);
bar.setProgress(-1);
bar.setMaxWidth(this.getWidth()-50);
logPane.getStyleClass().add("messages");
butt.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
butt.setDisable(true);
bar.setVisible(true);
new Thread(){
public void run(){
try {
new Updater().update(logPane);
} catch (IOException e) {
e.printStackTrace();
logPane.error("Couldn't start the update process");
}finally{
Platform.runLater(new Runnable(){
public void run(){
butt.setDisable(false);
bar.setVisible(false);
}
});
}
}
}.start();
}
});
controls.getChildren().add(butt);
this.setTop(controls);
this.setCenter(bar);
this.setBottom(logPane);
}