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

how to make all cells in GridPane visible and same size?

I've written the code below and that's the output. Is it possible to make all of the rows and columns(cells) visible and to make all of them certain size? The result I want is to have some sort of "net", so I can put in something into a cell and be…
Luiz
  • 1
  • 1
  • 3
0
votes
1 answer

Why is my javafx scrollpane immediately scrolling to the bottom?

I have a settings panel which is not resizeable that was getting crowded so I decided to add the gridpane which contains the settings to a scrollpane. The issue is that the scrollpane starts at the bottom when the application starts up. The weird…
Robin Withes
  • 61
  • 1
  • 6
0
votes
1 answer

JavaFX - ScrollPane within GridPane

I want a ScrollPane in my application window which doesn't fill the whole scene, but only takes up part of it, because I want to place a button beneath it. Like in this sketch: https://i.stack.imgur.com/cxizX.png I tried using a GridPane, but I can…
Don Joe
  • 274
  • 4
  • 13
0
votes
0 answers

In Javafx how to set the size cells of a gridpane a fraction of the parent pane?

I try to create a gridPane in JavaFx with a circle in it.I want the gridPane cells to use all the available space in the gridPane.(The GridPane is in the Center of a BorderPane) but the cells keep resizing to the dimensions of the inner objects.How…
0
votes
0 answers

Javafx setOnMouseClicked not working at all - ImageView - nothing

I'm trying to write a simple puzzle game in JavaFX. I want the image to be cut int pieces and then I would like to swap them when I click on them. The problem is the solution I had used to work when everything was in Main (as I created another scene…
0
votes
0 answers

Quadratic Resizing a Grid Pane in JavaFX

I am working on a game called pentago. After the user has occupied a field, the user has to rotate one of the four quadrants. The problem is that after the user has resized the window, the four quadrants are not quadratic anymore. And with non…
0
votes
1 answer

.getChildren().add() requires a node and cant add my object

I made a separate class to setup a grid within JavaFX. The class is as follows: public class Grid { GridPane gp = new GridPane(); //sets grid (10x10) gp.setHgap(10); gp.setVgap(10); gp.setBorder(null); gp.setPadding(new…
0
votes
1 answer

I can't correctly put my images to the window with using gridpane

I am trying to put squares to the application window. I am using gridpane and ı need to put 16 square with 4x4 array . With gridpane ı can create 3 row 4 column array , however ı can't put squares to the bottom row. Here is my code and results :…
user10499199
0
votes
1 answer

How to drag and drop button onto GridPane?

I'm working on a school project creating a simple battleship game and i want to use the Drag And Drop function to drag buttons from HBox on the bottom of the screen to the GridPane that the player uses to place ships on. But i can't get it to work…
Mampenda
  • 661
  • 4
  • 21
0
votes
1 answer

How To Add Objects In Grid from Bottom Up?

Im using a grid pane view to populate a grid using the add() method. By design of the add() the grid populates each row from top to bottom where location (0,0) is at the very top left most of the grid. Adding more rows are then appended below it and…
Potion
  • 785
  • 1
  • 14
  • 36
0
votes
0 answers

Creating delay between stages in JavaFX

I am showing a gridpane to user and I am updating it for couple of times in a for loop. What I need to do is, before each update, I need to create a second of delay in order to let the user see the stage for a second. VisualizationThread…
JollyRoger
  • 737
  • 1
  • 12
  • 38
0
votes
0 answers

Hbox doesn't fit in row in gridpane

Hbox (name: row0Hbox) doesnt fit in 0 row in Gridpane. I cant change it's height. I use a SceneBuilder. I tried to change percentes of row 0 and 1 and then try again but nothing helped. Hbox doesnt respond on any change of size. This is my first UI…
0
votes
1 answer

Dynamically sizing the contents of a GridPane to the properties of their parent

I am creating a "threes" clone for my assignment and one of the properties was to have a dynamically sizable GridPane depending on the number of columns and rows, how can I achieve this? I've looked at adding ColumnConstraints as well as…
0
votes
1 answer

.getRowIndex(); and .getColumnIndex(); Are No Shown as Options in the GridPane Class in JavaFX in Netbeans. How Can I Fix This?

I am using JavaFX in Netbeans. I am also using Scene Builder to create the FXML file. I have a GridPane named grid1 with two columns and two rows. I want to find out if their are any child objects in the grid. I would imagine that I use…
Maddog
  • 23
  • 5
0
votes
1 answer

Center a JavaFX ContextMenu in the middle of a screen?

I am trying to create a ContextMenu that appears in the middle of the screen whenever the keyboard's escape button is pressed. I want to use it to handle loading, saving, and exiting in my game. It will be called from classes outside of Main. The…
LuminousNutria
  • 1,883
  • 2
  • 18
  • 44