358 questions
0
votes
0
answers
41
views
JavaFX ComboBox rowSpan in GridPane not working programatically
I am trying to add programatically a ComboBox to an existing GridPane, called daysGridPane. This ComboBox is supposed to span two rows. The complete setup is a little bit more complex, as the ...
1
vote
0
answers
41
views
JavaFX stage size too small - Gridpane resizing
I created a JavaFX dialog in SceneBuilder. After playing probably an hour with the different layout attributes I can't find out how to open the stage in way, that all ui elements are properly ...
2
votes
1
answer
56
views
JavaFX - Different behavior of two GridPane in equal component hierarchy
I believe that the properties are defined equally in both. In the "correct.fxml" grid, if I add 1 row or 1 column, the respective ScrollPane's scrollbar appears. In the "wrong.fxml"...
5
votes
1
answer
96
views
Insert composite object (GridPane with TextFields) into ScrolPane
I have a class that builds a grid with an array of TextFields using GridPane. I need to insert this grid into a ScrollPane that only accepts Node in the setContent() method. So I extend this class ...
3
votes
1
answer
93
views
Is there a way to seperate the formatting of an object (spacing, padding, etc.) from others within a grid pane in javafx
So i'm recreating the structure of a calculator on javafx. Not for the functionality, but only for the looks. I have created the buttons and set the gaps between them to be 16, horizontally and ...
2
votes
1
answer
76
views
HBox doesn't fill parent GridPane when rotated by 90 degrees
I have created a gridpane as seen in the image and to this gridpane I add multiple HBoxes for the top row I have to rotate the HBox but when I do this the HBox doesn't fill the gridpane anymore for ...
0
votes
0
answers
50
views
How to fix grid pane not fitting underlying gridpane cell in javafx
so i have a grid pane and an image view both of size 1000. They are both placed on the game grid pane at the coordinates (0,1). They should be overlapping perfectly, but the grid pane is wider then ...
1
vote
1
answer
138
views
Difficulty Moving Multiple Circles Through JavaFx's GridPane
I am currently facing challenges while working with GridPane. My objective is to move a specified number of generated circles through the cells of a GridPane. I have 5 GridPane and in every one of ...
1
vote
1
answer
83
views
How do I get X and Y Coordinates of different rows and columns in a gridpane?
I'm currently making a game board and want to be able to move pieces from one tile to another. I'm trying to do this by getting the centerX and centerY of each tile as the user click on it, which ...
0
votes
0
answers
66
views
JavaFX drag-and-drop tiles between two GridPane's
I am working on a game as a personal project.
It involves tiles that appear both in a rack and on a game board.
The rack is a GridPane and the board is a GridPane.
I need to be able to drag and drop ...
3
votes
1
answer
83
views
JavaFX GridPane spacing issue
I have some code in which I am trying to display seven unique "squares" of characters.
There is a "Shuffle" button - upon clicking the characters should change sequence.
There is ...
-1
votes
1
answer
79
views
JavaFX GridPane fixed row size
I am working on a grammar analysis program. I am using a GridPane and have three TextAreas so far. The TextArea paliVerse should span over two rows; the TextArea analysis over four. However, when I ...
-3
votes
1
answer
1k
views
How To Add Columns to Gridpane in JavaFX
I'm trying to create a Tic-Tac-Toe-like program with a board size that users can select. I can't figure out how to adjust the size of a gridpane in the code. My only lead was using ColumnConstraints ...
0
votes
1
answer
300
views
JavaFX - Display Nodes at specific row and column in gridpane
I created an UI with JavaFX but have some problems with the layout. Basically I created a gridpane with a bunch of nodes. Here's the basic grid with the lines visible:
This is how I add all the nodes:...
0
votes
0
answers
38
views
JavaFX - Multiple nodes in one Grid Cell with specified width (in percentage possibly)
So I'm trying to add multiple Nodes in one Row of a GridPane with sizes in percentages. This is the UI, with the Grid Lines visible:
When the user clicks the Checkbox for "Check Editbuffer ...
2
votes
1
answer
139
views
Why does adding another element to a BorderPane mess up my formatting?
When creating a GridPane in the Center of a BorderPane it is quadratic and everything is fine:
even when having an uneqal amount of columns and rows everything works perfectly:
but as soon as I add ...
-2
votes
2
answers
827
views
Problems with Gridpane fxml layout
I have a fxml dialog in SceneBuilder, which contains a Gridpane on the right side of a Splitpane contained in a BorderPane. I have two issues with this dialog that relate to each other.
Problem #1 is ...
0
votes
1
answer
517
views
JavaFX Gridpane Layout with Colspan and Rowspan
I'm trying to center a button in JavaFX using Gridpane. I was told to use colspan and rowspan, but I can't figure out how those work.
pane.add(label1, 0, 1);
pane.add(text1, 1, 1);
pane....
0
votes
1
answer
176
views
Add action to GridPane in scene builder [closed]
I have a image_1, Title_1 and details_1, in a GridPane_1 as one,(see the picture).
I want to add an event to the GridPane_1 so if you enter the mouse to the GridPane_1 becomes a gray color background(...
-1
votes
1
answer
569
views
Resizable Buttons in 4*6 GridPane
My target is to build a Window in JavaFX where there will be 24 buttons, such way that:
The buttons should be placed in 4x6 grid (meaning 4 columns, 6 rows)
Edit the grid and buttons in a way that ...
-1
votes
1
answer
358
views
Group nodes in gridpane in JavaFx [closed]
is it possible to cluster cells of a gridpane in group nodes in javafx? The reason why I want to do this, is to apply different css selectors on subsets in the gridpane.
I have these cells in a ...
0
votes
0
answers
128
views
How to animate movement in GridPane(15x15)?
I am making TANKS2D game in javafx and the problem is when I shoot a bullet I can only move it once a few spaces and it stays there and cant be removed unless I remove it from a pane but if I do it's ...
2
votes
2
answers
1k
views
JavaFX: Update ImageView on GridPane click
I'm working on a Minesweeper game using JavaFX:
My GridPane is made of ImageViews, and I'm trying to find a way to figure out the column and row indexes of the image that was clicked on the GridPane. ...
3
votes
1
answer
319
views
Trying to deduce location of mouse drag with JavaFX Gridpane
Note: 25 years with Java, 2.5 hours (almost) with JavaFX.
I want to be able to highlight all cells of a GridPane that the mouse is dragged across - i.e. everything that intersects with the rectangle ...
0
votes
1
answer
629
views
How to swap two GridPane nodes in JavaFX?
I want to emulate the swapping of array elements in a GUI in javafx.
I have a grid pane Memory which acts like an array. Row 1 of the grid only has the array.
In each row/col I have added a stack pane ...
2
votes
1
answer
213
views
How to remove a "ghost line" in a GridPane in JavaFX?
I created a GridPane with 48 cells (8 columns x 6 rows), and I don't know why but there is a sort of "ghost line" that I'm not able to remove. Can you help me, please?
See the images with ...
-1
votes
1
answer
248
views
Getting X and Y values of a gridpane with HBoxes in every row [closed]
I have a script in JavaFX where I need to get the X and Y or the Row and Col values of a GridPane. Each grid has a HBox and the size of the HBox always varies as there are a random number of shapes in ...
0
votes
1
answer
127
views
GridPane col/row coordinate without node
I'm trying to figure out where the mouse is, in terms of a GridPane's column and row. I know the mouse position, so I could presumably figure it out from that, if I knew each cell's width and height (...
0
votes
1
answer
554
views
Javafx Is there a better way to add myObjects to GridPane?
i was searching for answer and trying so many options. Finally i found way to pass my own javaxf object to GridPane. But I still think there is a better way to this than I am doing.
So here is my code:...
2
votes
1
answer
154
views
Does Vaadin have the equivalent of a JavaFX GridPane?
In JavaFX, multiple UI elements can be displayed to the user in a grid, using a GridPane. Vaadin has a grid layout, however their Grid doesn't function as a container for other elements. Instead, it ...
-1
votes
1
answer
876
views
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 ...
1
vote
1
answer
192
views
How do I make all the fields in my javafx form clickable using GridPane and HBox?
I want to make a form with three sections, two with fields and one with buttons.
public class Form extends Application{
public static void main(String[] args) {
launch(args);
}
...
2
votes
0
answers
240
views
JavaFX TranslateTransition
i have a problem with the Translate Transitions. I have a GridPane 7x7. In each cell there is a StackPane. Each StackPane has 3 ImageViews. If i want to change the position of the last added ImageView ...
0
votes
1
answer
332
views
GridPane add() does not set column span
I have a little project in JavaFX. I'm trying to build a GridPane and I want to add a ChoiceBox, with a column span. I'd want to be large like the first one, but seems like something is not good.
...
0
votes
1
answer
129
views
GridPane in JaveFX
I have a project in school, where I need to do a 15 puzzle game in javaFX using the Controller and scene builder.
I have a problem beacause I want to use a grid pane to put my picture in it and using ...
0
votes
1
answer
459
views
JavaFX GridPane buttons in cells are too far from each other
I wrote a code which adds buttons in a GridPane, everything works as it should when I run the code. Only problem is that the buttons in their cells are too far from each other, the "best" ...
3
votes
2
answers
2k
views
Relative sizing in JavaFx GridPane
How can I set row / column sizes using weights on GridPane?
For example, if I wanted five rows where three were unknown fixed sizes, one took a third of the remaining space, and the other took two ...
0
votes
2
answers
221
views
ConcurrentModificationException while using Iterator<Node> [duplicate]
I was trying to delete a row of JavaFX GridPane with JavaFX Rectangles and I found no way to do so but copying the squares above to one row below. Here is my code to do that but it keeps throwing ...
-1
votes
2
answers
1k
views
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....
1
vote
1
answer
1k
views
JavaFX set margins for items in GridPane
I am trying to get some better layout and for that I would like to setMargin for my items inside a GridPane. This is what I tried (only for the first idLabel, idTextField, nameLabel, nameTextField for ...
0
votes
1
answer
67
views
Removing node at particular column of GridPane with mousepress
I am trying to remove multiple nodes, one at a time, from a GridPane by first getting the coordinates on mousepress, then using gridpane.getChildren().remove(column) using column as the index to ...
0
votes
1
answer
314
views
JavaFX - label below affecting the labels above
I'm trying to add a label beneath 3 labels I currently have on a different row, however it looks like the width of the fourth label that's below the top 3 is actually pushing away 2 labels on the row ...
0
votes
1
answer
2k
views
How to style the GridPane using CSS in JavaFx
I'm new in JavaFx. I have a GridPane created in FXML. I want to style that GridPane as the following image. I have tried with the following answers and tried with more CSS elements. But none of these ...
0
votes
1
answer
414
views
JavaFX/FXML: ImageView and labels inside BorderPane not displayed
My problem is that in the following construct, the bold marked images and labels inside a BorderPane inside a GridPane inside a ... aren't displayed. I placed the images and labels inside another ...
0
votes
1
answer
1k
views
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 ...
0
votes
1
answer
147
views
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 ...
0
votes
1
answer
787
views
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 ...
0
votes
0
answers
143
views
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) ...
0
votes
0
answers
156
views
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 ...
1
vote
0
answers
4k
views
Change exactly one label background color in JavaFx
I'm trying to create Tetris. I created GridPane and filled width and height with labels using nested for loop, then putted GridPane in to the scene. How can I change certain label background all ...