• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formating of Buttons in a Border Pane

 
Roger Wells
Ranch Hand
Posts: 51
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to learn how to create a ui

I am having problems understanding how to format this screen.

1. How do I center the top heading and have it always be centered within the scene when the user changes the size?
2. How do I get the 3 bottom buttons to have one on the left, one in the center, and one on the right and stay that way when the user changes the scene size?


 
Roger Wells
Ranch Hand
Posts: 51
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also want to add a grid pane to the left and a textarea to the right and replace the buttons.
Both grid and text should be scrolable

How do you edit a post once it has been posted?
 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I center the top heading and have it always be centered within the scene when the user changes the size?

Set the top, left, and right anchors to 0, then set the Label's alignment to TOP_CENTER.
 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I get the 3 bottom buttons to have one on the left, one in the center, and one on the right and stay that way when the user changes the scene size? 

Hmm... try a ButtonBar.
 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you edit a post once it has been posted?

There's usually a small window in which you can edit a post before someone replies, but for the most part, you should post again to the thread -- not the entire post, but just the correction.  This is so that the replies don't become confusing if they refer to a part of the post that is now different.
 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also want to add a grid pane to the left and a textarea to the right and replace the buttons.
Both grid and text should be scrolable 

Are you having problems with that?  What have you tried and what happened?  Do you have a specific question about this?
 
John Damien Smith
Ranch Hand
Posts: 299
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AnchorPanes aren't good for modeling resizable UIs.  You are probably better off using a different container type.
You can better understand JavaFX container types and layout tips by reading the Oracle layout documentation:
  http://docs.oracle.com/javase/8/javafx/layout-tutorial/
 
John Damien Smith
Ranch Hand
Posts: 299
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also try playing around with SceneBuilder and it's preview option to help understand how layouts work in JavaFX.
 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SceneBuilder can be downloaded here.  It is mostly for using FXML with JavaFX.

Note: I haven't had much trouble using Anchor Panes for resizable GUIs.  It takes some fooling around but it works well after that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic