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 pyramid patterns of Circle shape using GridPane in javafx

i wanna create pyramid left,right,center angle, using Circle shape in GridPane, i have already done with the left angle, but spent 2 days in creating right and center angle with no luck. i will be thankful if anyone knows or can give me some algo…
0
votes
1 answer

JavaFX - GridPane row increases in height after inserting a picture into a button

I have a gridpane of buttons. When I click on a button an ImageView is inserted into it and for some reason the cell height increases. I can't understand why and how can I fix it. How to make cell size constant? after button click the first row…
0
votes
1 answer

JavaFX GridPane of Equally-sized tiles not keeping correct sizes when images are added

I'm trying to make a simple chess game using a GridPane in JavaFX and I'm having trouble getting the board GUI to work. When pieces are added to tiles in the GridPane, the other tiles that don't have any piece on them get stretched out or shrunk. I…
Sam Hooper
  • 187
  • 8
0
votes
0 answers

Javafx BorderPane with 2 GridPanes, second GridPane not showing up

I need two grids in a BorderPane which is placed in a tab. When I add them both everything seems fine, but on launch only the first grid is visible. This is my code. public void start(Stage stage) throws Exception { BorderPane bp = new…
0
votes
0 answers

Formating dynamically added labels in JavaFX

I'm trying to change the background color of dynamically created labels. However, I can't seem to understand how to achieve this? Attached code snipped below. How can I change the background colors of the labels created and added to the…
Point
  • 1
0
votes
1 answer

Unsure as to why buttons will not align adjacent to each other in Java FX

I am new to java fx. I am creating a basic GUI which is meant to look like this: However, when I try my image looks like this: I am unsure as to why there is a large gap between the two buttons. I am using the grid pane format. Here is my…
0
votes
1 answer

Border Pane issues

I want to make a border pane with two HBoxes on top and bottom and a GridPane in the center... I wrote what I needed, attached the labels but I can't run the code Exception in Application start method java.lang.reflect.InvocationTargetException is…
Draven
  • 19
  • 1
  • 7
0
votes
1 answer

My messagebox does not work in this GridPane

I am taking a GridPane example from an book. The book is not the most recent. When I try to use the Internet I keep getting Scene Builder which is not what I want to use. I am using NetBeans IDE 8.2, and I have 2 problems with this program. Within…
Reed
  • 5
  • 6
0
votes
1 answer

Scrollbar in Javafx in not scrolling

I have a couple of line charts inside GridPane: @FXML private GridPane LineChartVBox = new GridPane(); And this is my Scrollbar: ScrollBar sc = new…
Lazar Gugleta
  • 115
  • 1
  • 2
  • 14
0
votes
0 answers

How to make ImageView images in a GridPane resizable?

I have a GridPane and in all of the cells ImageView containing Images. I successfully managed to make the GridPane resizable when I change the window size. The problem is that when the GridPane gets bigger the images won't grow. I know you can make…
mip42
  • 65
  • 6
0
votes
1 answer

Why added two ColumnConstraints in FXML?

I am new to JavaFX and in my sample.fxml file I found two ColumnConstraints but I don't know why there are two of them, because when I deleted one of them the view changed.
Abdelillah
  • 79
  • 1
  • 14
0
votes
0 answers

Change the background color of a StackPane

Today I'm trying to figure out how to change the colors of individual cells in a GridPane. Eventually, If the integer is divisible by 2, I want to color the cell blue. If the integer is divisible by 3, I want to color the cell yellow. If the integer…
0
votes
1 answer

getting current width and height of Gridpane

imageGrid = new GridPane(); imageGrid.prefWidthProperty().bind(gallerie.widthProperty().multiply(1.00)); imageGrid.prefHeightProperty().bind(gallerie.heightProperty().multiply(0.9)); imageGrid.setPadding(new Insets(20, 20, 20, 20)); …
BIKERSAN
  • 1
  • 2
0
votes
0 answers

GridPane elements initially extend of out bounds, only snaps into place after resizing window

I wish to create an 2x2 gridpane, where all child buttons are 25% of the GridPane. When I fill the StackPane with the GridPane, the children buttons extend past the constraints. The children buttons only snap to their positions after I resize the…
JXKENG
  • 89
  • 3
  • 10
0
votes
1 answer

How to fix Labels on GridPane stacking on index (0,0)? It seems to be ignoring my input to the function

I am trying to make a basic login screen in javafx using the GridPane layout. The issue is that all the labels I put onto the grid are going to position (0,0) seemingly ignoring my values for the column and row indices. I've tried putting extreme…