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

JavaFX Label in GridPane not extending

I'm currently making a little JavaFX application. In this application, I created a Label and wanted to stretch itself in both directions. The Label is placed inside a GridPane and I tried all Methods I know, including the Double.MAX_VALUE Method,…
Alex
  • 39
  • 1
  • 10
-1
votes
2 answers

How to align four buttons in one row using GridPane in JavaFx

I have a gridPane which is centre aligned.But four buttons in GridPane contain gaps between. How to get rid of this? What I have done is GridPane grid= new GridPane(); grid.setAlignment(Pos.CENTER); grid.setVgap(5); …
Bin
  • 3
  • 4
-1
votes
1 answer

Java FXML GridPane.getRowIndex(source) returning null always when handling mouse event in Scene Builder

I am new to Java FXML. I am still learning how to use Scene Builder 2.0 and controller classes. I don't understand why this is returning null @FXML public void gridClick(MouseEvent e){ Node source = (Node)e.getSource() ; Integer colIndex =…
-1
votes
2 answers

How do I see if a specific CheckBox is selected within a GridPane?

I've created a 10x10 GridPane of CheckBoxes. I need to see whether a specific CheckBox is selected, but the GridPane is made up of nodes. So If I access a particular node using a function from another thread, I can't use isSelected because it is the…
Felix H.
  • 75
  • 1
  • 6
-1
votes
1 answer

How to change the style of all the items in a grid pane using javafx?

I'm using a grid pane who contains some buttons. When we clicks on a button it changes the style and I'm implementing a reset button. What I'm trying to do is to apply a specific style when we clicks on that reset button. Here is my code where I try…
J.erome
  • 688
  • 7
  • 26
-1
votes
1 answer

JavaFX making buttons in a GridPane dynamically

I'm trying to make a JavaFX GridPane filled with buttons. I have an ArrayList with objects, and for each of those objects, a button needs to be made. However, the size of the ArrayList is not always the same. Therefore, I have so far made this…
Luctia
  • 322
  • 1
  • 5
  • 17
-1
votes
1 answer

Why is the If/Else statement not working at the second else if statement?

Here is the code: if(GridPane.getRowIndex(token1) == middleRow && GridPane.getColumnIndex(token1) == middleCol){ mainGrid.getChildren().remove(token1); } else if(GridPane.getRowIndex(token17) == middleRow &&…
Maddog
  • 23
  • 5
-1
votes
1 answer

How to divide content of ArrayList into two different columns

I have this ArrayList that you see underneath. I wish to divide my ArrayList into three columns, one showing the "category" of the item e.g. pizza or burger, one showing the names e.g. margherita, and one showing prices. Furthermore I wish to have a…
-1
votes
2 answers

Get cell location within GridPane Object on click or hover etc. javafx

I have GridPane that I'm using to create a calendar. When I hover over any of the calendar cells, I want to get the location of that specific cell. The end goal is to use the location of that cell to access its children and perform operations on…
-1
votes
1 answer

Add a GridPane to a ScrollPane using code javafx

Please how can I add a GridPane to a ScrollPane that I have in my fxml file with javafx code ?
learner
  • 11
  • 1
-1
votes
1 answer

JavaFX GridPane Changing Visibility of Specific Lines

I'm working on a JavaFX Sudoku game with a 9x9 GridPane as my board and I want to make the grid lines visible only around the boxes so every 3 rows and columns however I haven't been able to find any working solutions…
faris
  • 692
  • 4
  • 18
-1
votes
1 answer

Javafx GridPane ColumnConstraints causes clipping where overlap desired

I am making a login screen with a number pad. I have created my own button image for the button backgrounds. This button image has a shadow in it which is really just a semi-transparent dark blur. I have arranged these buttons in a GridPane where…
Jack J
  • 1,514
  • 3
  • 20
  • 28
-1
votes
1 answer

How to Get ImageView (not Node) from GridPane

I have to get an ImageView from a GridPane. I use this code, but it is for Node, while I'm trying to change an Image in an ImageView (inside GridPane). private Node getNodeFromGridPane(GridPane gridPane, int col, int row) { for (Node node :…
Alberto32
  • 229
  • 1
  • 4
  • 14
-1
votes
1 answer

JavaFX - How to get info on click by mouse

I hope this is the last post I open about this.. I have tried everything but my coord on GridPane return always null and not Integer... This is not a thread like this, it is a specific question, so please, don't close or do other actions. I have to…
Alberto32
  • 229
  • 1
  • 4
  • 14
-1
votes
2 answers

Creating a loop for column & row constraints with JavaFX

For my highscore window I have 20 nodes inside a gridpane (20 labels). Now I want the gridpane to be as big as the window itself which is 450 x 450, and I was planning to do this by adding column & row constraints. This is what I tried, but got a…
m4t5k4
  • 55
  • 9
1 2 3
23
24