Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to grow progress bar horizontally in javafx?

Tags:

I have an application where I have a table and ProgressBar. I want to expand my progress bar when user resizes the window. For TextBox in JavaFX I can able to set HBox priority and achieve it as intended. But for ProgressBar it is not working.

Can any one tell me where I am doing wrong ?

HBox root = new HBox();           
final ProgressBar browser = new ProgressBar();

//  final WebEngine webEngine = browser.getEngine();
// browser.setText("JJJ");
HBox.setHgrow(browser, Priority.ALWAYS);         
//  webEngine.loadContent("<b>asdf</b>");              
root.getChildren().add(browser);
scene.setRoot(root);