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

JavaFX tableview resize to fit window

I am just trying out JavaFX and am forcing my way into it because it is suppose to be the future. I am trying to create a table with 4 columns. The columns AND THE TABLE should resize to fill the parent pane. I cannot for the life of me get this…
bzanchi
  • 163
  • 1
  • 1
  • 5
14
votes
1 answer

GridPane layout debugging lines aren't displayed as expected when calling setGridLinesVisible(true)

I am trying to display the gridlines of a GridPane Scene in JavaFX, but they aren't being displayed despite calling setGridLinesVisible(true). What am I doing wrong? I want to display the gridlines on my program's main menu, so I can tell where to…
LuminousNutria
  • 1,883
  • 2
  • 18
  • 44
11
votes
3 answers

Center Align Rows of a GridPane in JavaFX

I have a GridPane in fxml that has a Text Title and 4 Buttons. The GridPane itself is center aligned, but all the buttons are left aligned inside the column of the grid. I know how to change the alignment of the items using Java code but this is not…
jlhasson
  • 1,516
  • 1
  • 15
  • 23
10
votes
1 answer

JavaFX - Border radius <-> Background color

If I add -fx-border-radius and -fx-border-width CSS to a simple GridPane, in its corner the background will not be "cut down". The CSS: .payload { -fx-hgap: 20px; -fx-padding: 40px; -fx-background-color: #2969c0; -fx-border-radius:…
Mehhhh.
  • 183
  • 1
  • 1
  • 12
9
votes
3 answers

How to display GridPane object grid lines permanently, and without using the setGridLinesVisible() method?

Is it possible to make all GridPane's grid lines permanently visible without using setGridLinesVisible()? I know that setGridLinesVisible() is for debugging purposes only, and I want to show grid lines for the end-user's convenience. Also, I need to…
RoastedCode
  • 133
  • 1
  • 2
  • 8
9
votes
2 answers

How to span columns of a gridpane manually in javafx?

I am trying to design a layout with gridpane which contains 2 rows and 2 columns. Top-left area and top right area shares width , they both get 50% of it. But in second row i need bottom right area to get 60% of width so bottom left area 40%. I've…
cengha
  • 173
  • 1
  • 2
  • 9
8
votes
2 answers

JavaFx GridPane layout how to set margin for an element in row?

I'm using GridPane layout for positioning things in my application. I'm wondering how I can set margin for an element in row GridPane.setConstraints(chip5, 1, 1, 1, 1, HPos.RIGHT, VPos.TOP); //I want to set // margin for chip5 from…
krychuq
  • 335
  • 3
  • 9
  • 22
6
votes
2 answers

Remove a row from a GridPane

I'm using a GridPane to stock informations about cities (in a game), but sometimes I want to delete some lines. This is the Class I use for my GridPane : import java.util.ArrayList; import java.util.Arrays; import java.util.List; import…
Franckyi
  • 243
  • 3
  • 12
6
votes
2 answers

TilePane with automatically stretching tiles in JavaFX

Is there any way in JavaFX to take best from both TilePane or FlowPane and GridPane? Here's what I'd like to achieve: First, I like the idea of GridPane where I can set up a M×N grid which automatically resizes within its parent container to divide…
SasQ
  • 14,009
  • 7
  • 43
  • 43
5
votes
2 answers

JavaFX displaying multiple images in grid pane

I am trying to make a simple program displaying 4 images in a grid pane. I get one in there no problem but once I attempt to add a second I run into some problems. Here is my code: package sample; import javafx.application.Application; import…
Matthew Hanson
  • 321
  • 5
  • 7
  • 15
5
votes
2 answers

JavaFX: ComboBox in GridPane causes unnecessary resizing

I have a GridPane with 5 columns. These are my hgrow setting for the column constraints respectively. SOMETIMES ALWAYS SOMETIMES (fixed sized) SOMETIMES ALWAYS The whole GridPane is basically a layout for a two-column form. My columns 1 and 4…
Jai
  • 8,165
  • 2
  • 21
  • 52
5
votes
1 answer

How to make buttons span mutiple columns/rows with GridPane JavaFX?

I'm new to JavaFX and is trying to make a simple button design with GridPane. I can't figure out how to make a button span multiple columns/rows without it pushing other buttons out of the way. I've been using HBox and VBox to group the other…
McLizardface
  • 53
  • 1
  • 1
  • 4
5
votes
1 answer

Possible to decide number of rows and columns in GridPane (JavaFX)

I was wondering if it is at all possible to decide the number of rows and columns a gridpane should have.
Johan Rovala
  • 174
  • 1
  • 2
  • 14
5
votes
2 answers

Dynamically add elements to a fixed-size GridPane in JavaFX

I would like to display a grid containing a various number of rectangles in JavaFX. It is important that this grid cannot be resized. I chose the GridPane layout. I dynamically add javafx.scene.shape.Rectangle to it. Here's how my grid looks like…
Koln
  • 307
  • 1
  • 4
  • 11
5
votes
4 answers

Javafx 2 : How do I delete a row or column in Gridpane

If I want to add a row of text fields programatically in JavaFx, i can simply use the gridpane add method This adds a set of text fields to row 1. for (int i = 0; i < Fields.size(); i++) { gridpane.add(new TextField(), i, 1); } Similarly, How…
Natty
  • 185
  • 1
  • 1
  • 9
1
2 3
23 24