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
2
votes
1 answer

Why does adding another element to a BorderPane mess up my formatting?

When creating a GridPane in the Center of a BorderPane it is quadratic and everything is fine: even when having an uneqal amount of columns and rows everything works perfectly: but as soon as I add a VBox or any other element to the left slot of…
HT256
  • 35
  • 5
2
votes
2 answers

JavaFX: Update ImageView on GridPane click

I'm working on a Minesweeper game using JavaFX: My GridPane is made of ImageViews, and I'm trying to find a way to figure out the column and row indexes of the image that was clicked on the GridPane. I have this code…
2
votes
1 answer

How to remove a "ghost line" in a GridPane in JavaFX?

I created a GridPane with 48 cells (8 columns x 6 rows), and I don't know why but there is a sort of "ghost line" that I'm not able to remove. Can you help me, please? See the images with and without padding to understand better what I mean. How the…
2
votes
1 answer

Does Vaadin have the equivalent of a JavaFX GridPane?

In JavaFX, multiple UI elements can be displayed to the user in a grid, using a GridPane. Vaadin has a grid layout, however their Grid doesn't function as a container for other elements. Instead, it appears to be used as a table for displaying…
qwerty
  • 810
  • 1
  • 9
  • 26
2
votes
0 answers

JavaFX TranslateTransition

i have a problem with the Translate Transitions. I have a GridPane 7x7. In each cell there is a StackPane. Each StackPane has 3 ImageViews. If i want to change the position of the last added ImageView with a Translate Transition it moves but it…
2
votes
1 answer

GridPane not giving label enough space when using columns with percentage widths

The code below generates this screen shot: The label below the 2nd column does not want to properly claim extra space when it needs to be wrapped. This only occurs when the columns use percentage widths -- the docs say it will ignore all other…
john16384
  • 7,800
  • 2
  • 30
  • 44
2
votes
1 answer

How to extend GridPane in JavaFX to override add() is giving NPE, Scene Builder breaks

Seems like a rarely asked question, so maybe extending GridPane is the wrong approach altogether. I did look at How to extend custom JavaFX components that use FXML and more. I am trying to create a LawnGrid class that extends GridPane, the reason…
JimLohse
  • 1,209
  • 4
  • 19
  • 44
2
votes
1 answer

Javafx treeview cell factory with gridpane

I have a TreeView and the GridPane contains multiple Nodes like Buttons and Labels. The amount of nodes inside the GridPane varies. I need the cell factory to get the MouseEntered event but when I use the code below then no content gets…
Panderas
  • 55
  • 1
  • 8
2
votes
1 answer

Adding Menubar to Gridpane

How do I add a MenuBar to a stage? I have tried including it in my GridPane (which I have added all my other elements to) but it never looks as if it is attached to the top of the window. Is there anyway to solve this? I used this code to place it…
MrDaveForDays
  • 121
  • 1
  • 7
2
votes
1 answer

How to fit an ImageView to a GridPane child node

I'm using SceneBuilder to create the View of my program. I need to have images inside GridPane nodes (cells), but the problem is that they should be fitted to the cell. In other words, as soon as I resize the application window, the gridPade…
Luca
  • 21
  • 2
2
votes
0 answers

JavaFX Removing columns in gridpane

I would like to delete fxml (added as a new column) from gridpane. For now, after clicking button, method addNextToCompare adds one column to mainGridPaneCarCompare and insert in that place new fxml from FXMLLoader. In my deleteColumn method I've…
newThomas
  • 21
  • 2
2
votes
1 answer

Distribute remaining space in GridPane or how to do it

We need a solution for a 3 column layout with the following requirements: The middle column has a fixed size The middle column is centered in the parent The other two columns both share the remaining space The other two columns both have the same…
Guardian667
  • 417
  • 4
  • 16
2
votes
0 answers

How to add border to part of a GridPane?

I'm trying to border to "grouped" cells in gridpane (or frames) so this is basically my gridpane: GridPane grid = new GridPane(); grid.setHgap(H_SIZE); grid.setVgap(V_SIZE); and I want to do something like this: grid.setBorder(1,1, H_SIZE/3,…
Moran Barzilay
  • 133
  • 2
  • 13
2
votes
2 answers

Square GridPane of square cells

My goal is to create a GridView that is resizable, always square and contains an equal number of rows and columns, making their cells also square, similar to a Reversi or Chess board. Here's a small illustration, the grid is centered horizontally on…
Marv
  • 3,517
  • 2
  • 22
  • 47
2
votes
2 answers

JavaFX transition animation fail to place the children of gridpane at the right place

I am writing a game similar to Bejeweled, and after running the application for some time the blocks fail to be exactly at the right place visually but logically they are at the right place. The situation is as the picture below. enter image…
Andy Lee
  • 33
  • 4
1 2
3
23 24