#Help with JavaFX Alignment

15 messages · Page 1 of 1 (latest)

ocean valve
#

I'm using a GridPane, this is the code to start it:

GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(10.);
grid.setVgap(10.);
grid.setPadding(new Insets(25,25,25,25));

I'm trying to make the small box be placed right next to the Add Word button. I've added the button and textInput with

Button addSpellBtn = new Button("Add Word");
grid.add(addSpellBtn, 0, 4);
TextField spellingAddField = new TextField();
grid.add(spellingAddField, 1, 4);

How would I go about putting them next to each other, but still keep it able to be moved around on the grid view?

Please and thank you in advance!

violet oracleBOT
#

This post has been reserved for your question.

Hey @ocean valve! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

violet oracleBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

ocean valve
#

Still looking for help!

subtle nymph
topaz herald
#

GridPane usually has less options when it comes to node alignment.

lunar talon
ocean valve
#

I’ll take a look at TilePane!

brittle stream
brittle stream
subtle nymph
#

U gusss he will not use SceneBuilder because it generates FXMLs and for some people it is just too complicated 😄

ocean valve
#

Not that it’s too complicated, I’d just rather do it programmatically
It’s just my personal choice

violet oracleBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.