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
0
votes
0 answers

JavaFX - Multiple nodes in one Grid Cell with specified width (in percentage possibly)

So I'm trying to add multiple Nodes in one Row of a GridPane with sizes in percentages. This is the UI, with the Grid Lines visible: When the user clicks the Checkbox for "Check Editbuffer Checksum", I want to display a ComboBox next to Checkbox in…
codeNoob
  • 21
  • 2
0
votes
1 answer

JavaFX Gridpane Layout with Colspan and Rowspan

I'm trying to center a button in JavaFX using Gridpane. I was told to use colspan and rowspan, but I can't figure out how those work. pane.add(label1, 0, 1); pane.add(text1, 1, 1); pane.add(radioButton1, 0, 2); pane.add(radioButton2,…
Kennedy
  • 1
  • 1
0
votes
1 answer

Add action to GridPane in scene builder

I have a image_1, Title_1 and details_1, in a GridPane_1 as one,(see the picture). I want to add an event to the GridPane_1 so if you enter the mouse to the GridPane_1 becomes a gray color background(for example), to denote the selection of the…
Talib3ilm
  • 33
  • 3
0
votes
0 answers

How to animate movement in GridPane(15x15)?

I am making TANKS2D game in javafx and the problem is when I shoot a bullet I can only move it once a few spaces and it stays there and cant be removed unless I remove it from a pane but if I do it's like it was never fired in the beginning (plus my…
L. Kranja
  • 1
  • 2
0
votes
1 answer

How to swap two GridPane nodes in JavaFX?

I want to emulate the swapping of array elements in a GUI in javafx. I have a grid pane Memory which acts like an array. Row 1 of the grid only has the array. In each row/col I have added a stack pane having image view and label. I want to change…
OmKshirsagar
  • 95
  • 2
  • 9
0
votes
1 answer

GridPane col/row coordinate without node

I'm trying to figure out where the mouse is, in terms of a GridPane's column and row. I know the mouse position, so I could presumably figure it out from that, if I knew each cell's width and height (which I don't see an easy way to figure out) but…
user3810626
  • 6,798
  • 3
  • 14
  • 19
0
votes
1 answer

Javafx Is there a better way to add myObjects to GridPane?

i was searching for answer and trying so many options. Finally i found way to pass my own javaxf object to GridPane. But I still think there is a better way to this than I am doing. So here is my code: Main: package sample; import…
Pedogreen
  • 3
  • 2
0
votes
1 answer

GridPane add() does not set column span

I have a little project in JavaFX. I'm trying to build a GridPane and I want to add a ChoiceBox, with a column span. I'd want to be large like the first one, but seems like something is not good. public class Main extends Application implements…
beni
  • 9
  • 1
0
votes
1 answer

GridPane in JaveFX

I have a project in school, where I need to do a 15 puzzle game in javaFX using the Controller and scene builder. I have a problem beacause I want to use a grid pane to put my picture in it and using the index to change position. Here is my code : …
snsdtiti
  • 35
  • 6
0
votes
1 answer

JavaFX GridPane buttons in cells are too far from each other

I wrote a code which adds buttons in a GridPane, everything works as it should when I run the code. Only problem is that the buttons in their cells are too far from each other, the "best" outcome I got is the one below, but it's not good since…
SA.93
  • 141
  • 14
0
votes
2 answers

ConcurrentModificationException while using Iterator

I was trying to delete a row of JavaFX GridPane with JavaFX Rectangles and I found no way to do so but copying the squares above to one row below. Here is my code to do that but it keeps throwing ConcurrentModificationAcception. static void…
Akmenah
  • 31
  • 8
0
votes
1 answer

Removing node at particular column of GridPane with mousepress

I am trying to remove multiple nodes, one at a time, from a GridPane by first getting the coordinates on mousepress, then using gridpane.getChildren().remove(column) using column as the index to remove. This works as expected if I start with an…
Michael
  • 87
  • 8
0
votes
1 answer

JavaFX - label below affecting the labels above

I'm trying to add a label beneath 3 labels I currently have on a different row, however it looks like the width of the fourth label that's below the top 3 is actually pushing away 2 labels on the row above, even though I have set this label to be on…
Ben Whitely
  • 47
  • 2
  • 8
0
votes
1 answer

How to style the GridPane using CSS in JavaFx

I'm new in JavaFx. I have a GridPane created in FXML. I want to style that GridPane as the following image. I have tried with the following answers and tried with more CSS elements. But none of these helped me to do this. JavaFX CSS class for…
H Athukorala
  • 739
  • 11
  • 32
0
votes
1 answer

JavaFX/FXML: ImageView and labels inside BorderPane not displayed

My problem is that in the following construct, the bold marked images and labels inside a BorderPane inside a GridPane inside a ... aren't displayed. I placed the images and labels inside another BorderPane so each row of the GridPane has more…
Varest
  • 57
  • 1
  • 11