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
2 answers

JavaFX: Resizing Panes when resizing window

I'm trying to build a simple Java project which contains 6 Panes (added to GridPane Layout as parent). I had to set up window size at the beginning, and managed to split them evenly by referring to the width and height of the root…
Dominika
  • 187
  • 3
  • 13
0
votes
1 answer

How to Reference a Particular Node in a GridPane

I have a grid of tiles with a stack pane on top of each tile in order to place a shape on each tile. I want to have a method by which I can remove the stack pane from a particular tile on the grid, which means that in effect it should remove the…
user9871833
0
votes
2 answers

JavaFX GridPane Object Alignment

I am trying to use JavaFX to create a scene with the program's title positioned at the top-center, and buttons in a vertical line along the left side of the scene. However, both of these elements are displayed clustered up in the top-right of the…
LuminousNutria
  • 1,883
  • 2
  • 18
  • 44
0
votes
1 answer

How can I manipulate childrens of a GridPane in JavaFX?

I made a Chess Board using JavaFX, and set all the tiles to be children of the GridPane, is there a way I can acess these tiles and change their properties using the GridPane index? I tried to change the color property of one tile by acessing it by…
user9342284
0
votes
1 answer

Add a top menu to JavaFX centered Grid Pane

I'm very new to JavaFX. I am using a grid pane to keep my items centered on the page regardless of how the window is resized. I want to add a menu that runs along the top. I quickly found out grid.setTop(menuBar) is not a member function of grid…
0
votes
0 answers

Creating a Matrix of ImageView Objects

I'm making the game Minesweeper for a project in class, and I've settled upon making a GridPane, and then adding a Matrix of ImageView objects, i.e. GridPane grid = new GridPane(); ImageView[][] gridButtons = new ImageView[16][16]; …
C.S.
  • 11
  • 1
0
votes
2 answers

Only one responsive column in GridPane

I need to do something like the below in JavaFX: Can you tell me how can I get only one column to change size (the middle one) in a GridPane layout? These black bordered rectangles are VBoxs. Basically, the width of VBoxs must stay the same and the…
Paxon96
  • 23
  • 3
0
votes
1 answer

JavaFX Adding row on GridPane after 2 seconds

Given: BorderPane root = new BorderPane(); GridPane block = new GridPane(); block.addRow(0, new Text("HELLO")); ScheduledExecutorService someScheduler = Executors.newScheduledThreadPool(4); someScheduler.schedule(() -> { …
P. Daimaou
  • 51
  • 5
0
votes
1 answer

GridPane doesn't align in center

I am making a Login Screen with a number pad, and I can't seem to center align a GridPane of buttons in a Pane. What am I doing wrong? Main.java import javafx.application.Application; import javafx.geometry.Rectangle2D; import…
Jack J
  • 1,514
  • 3
  • 20
  • 28
0
votes
1 answer

JavaFX: Snakes And Ladders - Represent snakes and ladders images in a GridPane

I am creating the game Snakes And Ladders. The 10x10 matrix you see is a GridPane where every cell contains a colored Pane. PROBLEM: I want to place images instead of the arrows you see above that represent the snakes and the ladders. Is spanning…
A.Tressos
  • 35
  • 7
0
votes
0 answers

JavaFX GridPane rowspan height error

It seems to me, that GridPane calculates wrong height over its Nodes when I use rowspan. // 01 - Half OK final GridPane gp = new GridPane(); gp.add( new Text( "aaa\nbbb\nccc\nddd\neee" ), 0, 0, 1, 2 ); gp.add( new Text( "aaaa1" ), 1, 0, 1, 1…
Dmitry
  • 105
  • 1
  • 9
0
votes
2 answers

JavaFX - How to get AnchorPane inside a GridPane and add Text on it?

I know I can add Text or Node inside GridPane with the Following code Text text = new Text("Hello World"); gridPane.add(text, row, column); But I have AnchorPane inside every rows and columns of GridPane which is manually inserted by the help of…
Polar
  • 3,327
  • 4
  • 42
  • 77
0
votes
0 answers

JavaFX GridPane contains non defined spacing

Iam trying to add some Labels to a GridPane. Those Labels contain ImageViews which contain some Images. My images are .png-images and are 50 x 50 pixels big. If my GridPane is getting to big to display it on my screen, I want to resize my Images.…
Moritz Schmidt
  • 2,635
  • 3
  • 27
  • 51
0
votes
1 answer

Resizing ImageViews

I have a GridPane (4x5), all it's cells have as child an AnchorPane which cointains an ImageView. I need to resize the image so it fully cover the cell as soon as the gridPane (and thus it's cells) change size. I managed to resize the image…
Luca
  • 21
  • 2
0
votes
1 answer

How to handle wrong drop location in JavaFx?

In my GUI I create some dices (ImageView) and I can drag and drop them in one specific GridPane. When I drop a dice into the specific GridPane, the dice disappears from the initial location and it moves to the right position. This works fine only if…
lordp
  • 7
  • 3