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

JavaFX (partially) hide image outside gridpane

Basically I've got this layout: Image of the GUI layout. It is a BorderPane (Black) with a Menubar (Red), a Container with some stuff in it, in the left sidebar (Green) and a GridPane (Gray) nested inside the center (Orange) The cells of the…
DJSchaffner
  • 562
  • 7
  • 22
4
votes
5 answers

JavaFX: Inserting image into a GridPane

Basically, I just want to insert an image into a cell within a gridpane. GridPane gridpane = new GridPane(); gridpane.add(new Image("File:image/myfile.jpg")); getChildren().addAll(gridpane); Always tells me "Image is abstract, cannot be…
4
votes
2 answers

Failed to load FXML file in JavaFX

So as I'm trying to do the tutorials for JavaFX and am working on the FXML example. But whenever I add something to the GridPane in the .fxml file the program crashes. It opens a normal GridPane if nothing else is put in it. Code For the FXML…
Driskus
  • 43
  • 3
3
votes
1 answer

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 also a "flying" effect added. The shuffle and flying effects are…
chasse
  • 225
  • 2
  • 9
3
votes
1 answer

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 cornered by the click point and the current drag…
3
votes
2 answers

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 thirds of the remaining space (see image below), how…
Dan
  • 7,286
  • 6
  • 49
  • 114
3
votes
1 answer

JavaFX dynamically adding new text fields

I'm writing a program that will allow a user to add new, empty text fields in the event that more data needs to be added to the form. I'm having trouble understanding how to set the coordinates for each new field that is added to my GridPane. For…
nammrick
  • 99
  • 1
  • 2
  • 8
3
votes
2 answers

Creating a dynamic GridPane (add and remove rows)

So I need to add and delete Rows in a GridPane when selecting or deselecting a MenuItem. So when selecting a MenuItem it should add 1 or 2 rows in the existing GridPane. When deselecting it should remove 1 or 2 of the rows. There is always a fixed…
user2909180
  • 203
  • 3
  • 11
3
votes
1 answer

JavaFX GridPane col/row span vs index

I'm learning JavaFX through the Oracle Tutorial and I'm confused about this particular topic. I seem to be the only one confused as my searching hasn't led to any helpful results. I'm creating a basic GridPane with 2 columns (0,1) and 3 rows…
Alex Jones
  • 226
  • 3
  • 13
3
votes
1 answer

JavaFx Images in Gridpane slowing down performance drastically

I want to create a GridPane (which is nested in a ScrollPane) where I add dynamically cells to the GridPane. Each cell contains a VBox with a BackgroundImage, a few Labels and a Checkbox. The Problem is, that the GridPane can contain several…
3
votes
2 answers

JavaFX GridPane Dynamic Resizng of Child Nodes to Fill Assigned Area

So I am using a GridPane with the aim of having it's child notes resize to fill the available space provided to the GridPane based on the porportions assigned to the components when they were added to the grid. I have spent time on SO looking at…
Andrew S
  • 2,847
  • 3
  • 33
  • 50
3
votes
1 answer

JavaFX Drag&Drop events on Gridpanes

I tried to do a Drag&Drop-Event in a grid pane, but it didn't work. The drag is detected but neither the drag over nor the drop event. What I'm doing wrong? Here is the code I tried: public class FXMLDocumentController implements Initializable { …
Syrious
  • 91
  • 2
  • 8
3
votes
1 answer

JavaFX 8 - GridPane autosizing issue

There is an issue with the GridPane autosizing when setting some specific span configuration. The following configuration works as I expect: import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import…
Jonathan
  • 127
  • 1
  • 11
3
votes
2 answers

JavaFX: Button's width in custom gridpane

I would like to have buttons with equal(maximum) width in a gridpane. When I'm trying to set it directly in FXML - it works perfectly.
wlek
  • 33
  • 1
  • 4
3
votes
1 answer

How do I position buttons that span multiple columns in JavaFX GridPane?

I'm trying to position 3 buttons side-by-side across the first row, but they are all stacking on top of each other. The actual button processes seem to work fine, but the button positioning is all wrong. How do I get these buttons to space out using…
user3905238
  • 33
  • 1
  • 3
1
2
3
23 24