Questions tagged [gridpane]

GridPane lays out its children within a flexible grid of rows and columns

GridPane lays out its children within a flexible grid of rows and columns. If a border and/or padding is set, then its content will be layed out within those insets. A child may be placed anywhere within the grid and may span multiple rows/columns. Children may freely overlap within rows/columns and their stacking order will be defined by the order of the gridpane's children list (0th node in back, last node in front).

GridPane may be styled with backgrounds and borders using CSS

349 questions
1
vote
1 answer

JavaFX How to make a GridPane fit to ScrollPane parent?

I need page with a grid where entering some data so, using SceneBuilder , I put a GridPane inside an AnchorPane. The gridpane I need has huge height so I wrap it inside a ScrollPane and make the ScrollPane fitting to AnchorPane. But now when I…
Adl
  • 127
  • 3
  • 13
1
vote
0 answers

No suitable method found for add() in Javafx

I try to add a borderpane in my gridpane with the method add() like that : GridPane grid = new GridPane(); grid.getChildren().add(new BorderPane()); grid.getChildren().add(new BorderPane(), 1, 0); // ERROR HERE But I receive this error : error:…
mtnp
  • 314
  • 7
  • 24
1
vote
1 answer

Put labels on panes in gridpane in javafx

I want to programatically put labels in my panes. I have a gridpane which is 11x12. The fields is in the outer fields. What i need to achieve is add my MonopolyConstants.FIELD_NAMES[I] to the labels that has to be in the pane. So far my code look…
Codeboy
  • 35
  • 1
  • 11
1
vote
1 answer

How do you make AnchorPane resize with the window?

I'm using Scene Builder to design a layout. The parent node is an AnchorPane, which contains a GridPane that should resize with it. The AnchorPane, however, stops resizing with the GridPane (I think). How can I make it resize as the window enlarges…
Skywarp
  • 989
  • 3
  • 15
  • 32
1
vote
0 answers

JavaFX - get index row and index col by OnClick on GridPane

I need to get the index of my specified click over my GridPane called myGrid. If I put a piece on board from my coord like here below, it works.. for example: myGrid.add(new ImageView("othello/images/white.png"), 4, 3); If I want to take the…
Alberto32
  • 229
  • 1
  • 4
  • 14
1
vote
0 answers

JavaFX - Reset game and delete nodes - Othello + get row and col by OnClick

I need to restart my game and remove my ImageView with white or black pieces on my GridPane 8x8 (called myGrid). If myGrid is empty, restart works, and it put 4 pieces (2 white and 2 black) in the center of myGrid. If I fill my GridPane, instead, i…
Alberto32
  • 229
  • 1
  • 4
  • 14
1
vote
1 answer

ImageView can't find image URL

I have problem with displaying images in the GridPane. I got error that Input stream must not be null. Exception is in first row of the creating object of ImageView. As you can see pictures are in folder. What can be a problem. ImageView windows…
MiOnIs
  • 125
  • 12
1
vote
1 answer

adding array of map to java application

I am pretty new to Java but I am trying to create a map of a room using an array however I do not know how to add it to my app class. Since the code is too long I will share the view class I have been trying to work with in order to add it to my…
comp1005
  • 25
  • 6
1
vote
1 answer

Refering to a textfield in Gridpane

alright. So to give ya'll some background info: I'm programming a sudoku, haven't worked too much with GUI but done much research. I've created a 2 for loops creating a 9x9 Gridpane filled with textfields with the following code GridPane grid = new…
brovatten
  • 27
  • 5
1
vote
0 answers

Player character not adding to GridPane Javafx

I'm making a 2D game that requires a 2D character which will be able to eventually move around objects itself. I've been trying to get my movement method to work, and whilst I think with help I've cracked it, I've noticed that I've only been adding…
SteveMunroe
  • 21
  • 1
  • 7
1
vote
2 answers

How to shift buttons in the GridPane?

I wanna the buttons B and D will be remained on their places when the A and C will be disappeared, but instead of it there are shifted to the center. How could I shift them back to their places? fifty.setOnAction(e->{ …
Hasan Shans
  • 57
  • 11
1
vote
1 answer

JavaFX How to Center Multiple Components side by side

I have 2 components: Label & Button. I want to put them side by side & align them together in CENTER. But I failed to do so, as they are still aligned LEFT but not CENTER. My code as below: Label sloganLbl = new Label("With cost as low as $1.99,…
Shuwn Yuan Tee
  • 5,578
  • 6
  • 28
  • 42
1
vote
1 answer

Is It Possible To Use CSS To Position A JavaFX GridPane Within A Scene?

As the title says, I have a gridpane with several elements in it in JavaFX & I was wondering if I could use CSS to position this in the bottom right of the scene? I've tried using setID on my gridpane then referring to it in the CSS but it doesn't…
Andrew
  • 159
  • 2
  • 11
1
vote
2 answers

JavaFX continuous form dynamically add new row with content in gridpane

I need some help creating a continuous form with a gridpane like in ms access. Initially the gridpane has 1 row and 3 columns | Choicebox | Delete Button | Add Button | public class myGridpane { @FXML private GridPane gp_form; …
tonyh
  • 35
  • 3
  • 8
1
vote
0 answers

JavaFX: The GridPane and column constraints

I have a ScrollPane control with left and right parts inside. Left part contains a GridPane control. I would like to make the GridPane across the entire width of the parent VBox control. For this purpose, I used a columnConstraints. Now, the…
David
  • 527
  • 1
  • 8
  • 21