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
0
votes
0 answers

Mouse Click event on GridPane JavaFX-8

The solution is probably staring at me in the face. But here's my problem. Take a look at this method: public void showUserData() { int numUsers = usersModel.numberOfUsers(); // number of users(rows) in the database ColumnConstraints…
ace_01S
  • 387
  • 2
  • 5
  • 16
0
votes
2 answers

Add invisible row in javafx gridpane

I would like to add an invisible row in a gridpane. Then I would like to show and hide it based on user selection. I've managed to get the general functionality working but the problem is when the row content are hidden there is an extra space. I am…
Suemayah Eldursi
  • 969
  • 4
  • 14
  • 36
0
votes
1 answer

Spacing JavaFX LineCharts in GridPane

So right now I am trying to write a program for displaying data in JavaFX LineCharts. My main panel is a BorderPane with some features on top/left/right/etc.. in the center of the panel I want to display the LineChart(s). At least 1 and a maximum of…
0
votes
1 answer

Cropping Image of ImageView in a Group container - Javafx

I have a problem in Grouping, javafx. My program is to draw a Rectangle on ImageView for cropping the Image. The co-ordinates are obtained from mouse press and mouse release. When i put the group in GridPane layout the rectangle is not drawn at…
0
votes
1 answer

GridPane Percentage Width

I want to create a GridPane with 3 columns in JavaFX using FXML. There is a big label in center column. The center column takes the width of the label. The left and right column share each half (50%) of the remaining width of the form. I…
M. Ko
  • 563
  • 6
  • 31
0
votes
1 answer

Can I include a JavaFX LineChart in a JavaFX GUI

I would like to declare a JavaFX GridPane of two panels, the left one containing a push button. When the push button is clicked a LineChart is displayed in the right hand panel. The coding would presumably look like this: public class FormLineChart…
Rusty
  • 93
  • 1
  • 14
0
votes
1 answer

Javafx - Determine position of cursor on right click relative to gridpane

I have a 40x40 gridpane, displaying a map. Currently, i have the following methods listening for a right click: //detect right click + display menu, select if you want to place item 1 or item 2 final ContextMenu cm = new ContextMenu(); …
asdf
  • 5
  • 1
  • 6
0
votes
1 answer

JavaFX - Is there a method to print one image multiple times using imageview?

Given the code below, i'm trying to print out a single image (stored in variable 'image') multiple times. Any suggestions as to how i'd go about doing this? Any information would be useful. Image image = new Image("tileset.png"); ImageView…
asdf
  • 5
  • 1
  • 6
0
votes
1 answer

Unable to Center a Grid Using JavaFX

I'm using grid.setAlignment(Pos.CENTER); to center my grid within the JavaFX scene however it doesn't seem to work. The grid always displays in the top left of the scene no matter what position I give it. Can anyone see what I'm doing wrong? My…
Andrew
  • 159
  • 2
  • 11
0
votes
2 answers

How to get screen/scene center x,y of Rectangle within a GridPane?

I'm working on a simple board game implementation in JavaFX8. For the game board, my decision was to use a 10x10 GridPane and fill it's cells with Rectangles in form's initialize method. private void drawBoard() { …
Igal Klebanov
  • 348
  • 2
  • 15
0
votes
2 answers

How can labels be iteratively added to a GridPane in JavaFX?

I'm trying to iteratively add labels to a GridPane in JavaFX using a for loop, but I keep on getting an error when I try to launch the application. The console output is: Exception in Application start method Exception in thread "main"…
Rohitus
  • 159
  • 2
  • 7
0
votes
1 answer

is getChildren on Gridpane sorted? (javafx)

I want to get the node in a GridPane by index, I know you can do this by iterating through getChildren, but I was wondering if there was a less ugly way to do it. If I knew getChildren was sorted, it could be done by getChildren.get( row*width +…
e2298
  • 145
  • 1
  • 1
  • 7
0
votes
1 answer

Resetting Previously Clicked Label on GridPane

I am creating a mini game which contains a set of labels that start out as black, but turn yellow once it's clicked. What I want to happen is for the previously clicked label to turn back to black when the currently clicked label is turned yellow.…
0
votes
1 answer

Inserting a row into a Gridpane

I'm trying to insert a row into a grid pane. How can I achieve this? Further reading/information/effots: I've been able to append the row with this: add.setOnAction(new EventHandler() { @Override public void…
Chemistpp
  • 2,006
  • 2
  • 28
  • 48
0
votes
1 answer

Center Horizontally a Row in a GridPane JAVAFX

I want to center horizontally one row in my GridPane. I know how to center horizontally a column ( root.getColumnConstraints().get(0).setHalignment(HPos.CENTER);), but I can't find this method for Rows. I can only change the Halignment property of a…
Franckyi
  • 243
  • 3
  • 12