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
vote
3 answers

Swapping nodes in a Gridpane for chess game

I'm unable to click one button, then click another button to swap with the previously clicked button. Then make the first clicked button a blank button. I can't think of how to do this. I just try with if statements like If button = this{ …
Travelsbyfire
  • 35
  • 1
  • 10
1
vote
1 answer

JavaFX swapping buttons on gridpane

I'm writing a puzzle game in JavaFX. Can you make a button swap on a gridpane with another button after clicking it? Ex. I want to swap button number 1 and 9 after i press button 1. I think it should be possible to change place on gridpane. Ex when…
1
vote
1 answer

Getting images to show on grid-pane dynamically

My goal is to display images that are selected from a filechooser activated by button, and add those images to my gridpane. I am able to get the right URL file path name from the file chooser in order to make a correct imageview however when doing…
Zieryn
  • 27
  • 6
1
vote
3 answers

Vbox not filling up all of the available space in a gridpane

I am currently developing a messenger in javafx. my general layout is a gridpane with a customized Vbox containing a ListView and a Textfield. The problem is that as you can see below there is a big emty area beneath the textfield. I already tried…
Raffael
  • 33
  • 5
1
vote
1 answer

How to create a scrollpane that would scroll in a vertical direction forever?

I'm not sure if this is possible and I couldn't find anything on it, but could I make a scrollpane scroll forever? I am constantly adding new buttons and labels into the window once a button is pressed, and eventually is gets to the bottom. I may…
user10238840
1
vote
0 answers

JavaFX: GridPane align label to the right

For hours I'm trying to get this result: Design, GridDesign, FinalResult My problem here is that I cant align properly the TotalPrice label, I want it to take 2 columns and align to the most right of the grid, when the label size gets bigger(More…
1
vote
1 answer

Why Do I Get The Errors: java.lang.IllegalArgumentException and java.lang.reflect.InvocationTargetException In Netbeans?

Alright, so... I created an Javafx app using Netbeans and Scene Builder. The picture included in this past is the app. The goal of the program is to move a Circle back and forth in a GridPane. There is one column with two rows (0,0 and 0,1) Each…
Maddog
  • 23
  • 5
1
vote
1 answer

randomly displaying circles within gridPane cells in javaFX

I am creating am application that displays circles (of different colors) randomly within each cell of a gridPane. What i want to do is create a "shuffle" button that changes the position of each circle randomly within the gridPane. However, I keep…
Leemi
  • 103
  • 8
1
vote
0 answers

Rearranging texts in javafx

I am using Javafx. I have gridpane(1,2). My gridpane ends with buttons (1,2) and (0,2). I want to write something under these buttons. I added a text into gridpane. However, since my text's widht is longer than the buttons, the layout does not look…
numudoka
  • 25
  • 7
1
vote
2 answers

Why do the node positions in my gridpane affect the layout of my grid?

I'm trying to recreate the "snake" game using GridPane in JavaFX. My code seems to run properly except for this specific error, where anytime I use my keys to traverse the green node (titled head) toward the yellow node (titled food), the rows or…
1
vote
1 answer

JavaFX - Multiple Grid Panes - Only One is connecting, the rest are null

In my JavaFX program I have multiple grid panes. The FXML code I have is here.
DaveK
  • 544
  • 1
  • 6
  • 16
1
vote
1 answer

JavaFX - Adding Image to a GridPane Manually

I have the following setup The three tic tac toe boards are gridpanes in JavaFx. I am trying a very simple approach of adding an ImageView to the grid node in order to indicate if it is an x or o. The code I am doing that with is. private void…
DaveK
  • 544
  • 1
  • 6
  • 16
1
vote
1 answer

Center children in GridPane using CSS

I have a GridPane populated with ToggleButtons. First row and column in that GridPane holds Text object labels. I am unable to center the Text objects with the ToggleButtons so the text appears in the middle, using css. (This answer shows how to…
c0der
  • 18,467
  • 6
  • 33
  • 65
1
vote
1 answer

Amount of permutations inside an area?

I have the following case: An GridPane divided into cells, so f.e. 6 x 6 = 36 cells A concrete number of Elements which need to fit into this area, f.e. 6 Each element has an area, f.e. {3, 6, 4, 5, 6, 12}, so that the total area is again the…
lydiaP
  • 123
  • 1
  • 13
1
vote
0 answers

Javafx gridpane margin with columns

I'm using a gridpane and the second row has 4 columns. Is it possible to align them with the rows that has 3 columns? I've looked around a lot and haven't found a solution for this yet. Here is an image of the visual
Kev5
  • 21
  • 1
  • 9