gridpane

ConcurrentModificationException while using Iterator<Node> [duplicate]

≡放荡痞女 提交于 2021-02-17 03:29:32
问题 This question already has answers here : Concurrent Modification Exception : adding to an ArrayList (10 answers) Closed 7 months ago . 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 ConcurrentModificationAcception . static void copyAbove(int rowToBeDisappear, GridPane mainGrid) { for (int y = (rowToBeDisappear-1); 0 <= y ; y--) { for (int x = 0;

How to drag and drop button onto GridPane?

人走茶凉 提交于 2020-11-30 00:37:47
问题 I'm working on a school project creating a simple battleship game and i want to use the Drag And Drop function to drag buttons from HBox on the bottom of the screen to the GridPane that the player uses to place ships on. But i can't get it to work properly. Here's a picture of my board per now. I have tried to use the button.setOnMouseDragged(e -> {CODE HERE}); but it doesnt work. Here is the code i used for my window public class GridOrganizer { private BorderPane borderPane; public

How to drag and drop button onto GridPane?

北城以北 提交于 2020-11-30 00:32:55
问题 I'm working on a school project creating a simple battleship game and i want to use the Drag And Drop function to drag buttons from HBox on the bottom of the screen to the GridPane that the player uses to place ships on. But i can't get it to work properly. Here's a picture of my board per now. I have tried to use the button.setOnMouseDragged(e -> {CODE HERE}); but it doesnt work. Here is the code i used for my window public class GridOrganizer { private BorderPane borderPane; public

JavaFX - Iterate GridPane nodes per row - Read Nodes of GridPane per row

不打扰是莪最后的温柔 提交于 2020-08-25 10:57:58
问题 I am creating an application using JavaFX 8. I change the content of a grid pane dynamically using drag/drop. I wish to iterate GridPane contents per row or per row/col. JavaFX allows adding nodes in a GridPane by specifying the row and column. gridPane.add(node, col, row); I would like to read the nodes of a GridPane on the same way, by specifying the row and column. I would like to have something similar to the below source (the below code is not correct), for(int row = 0; row <

JavaFX - Iterate GridPane nodes per row - Read Nodes of GridPane per row

↘锁芯ラ 提交于 2020-08-25 10:56:39
问题 I am creating an application using JavaFX 8. I change the content of a grid pane dynamically using drag/drop. I wish to iterate GridPane contents per row or per row/col. JavaFX allows adding nodes in a GridPane by specifying the row and column. gridPane.add(node, col, row); I would like to read the nodes of a GridPane on the same way, by specifying the row and column. I would like to have something similar to the below source (the below code is not correct), for(int row = 0; row <

JavaFX - Iterate GridPane nodes per row - Read Nodes of GridPane per row

…衆ロ難τιáo~ 提交于 2020-08-25 10:54:28
问题 I am creating an application using JavaFX 8. I change the content of a grid pane dynamically using drag/drop. I wish to iterate GridPane contents per row or per row/col. JavaFX allows adding nodes in a GridPane by specifying the row and column. gridPane.add(node, col, row); I would like to read the nodes of a GridPane on the same way, by specifying the row and column. I would like to have something similar to the below source (the below code is not correct), for(int row = 0; row <

Center children in GridPane using CSS

坚强是说给别人听的谎言 提交于 2020-06-28 06:32:28
问题 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 ToggleButton s so the text appears in the middle, using css . (This answer shows how to achieve it by using GridPane.setHalignment(node, HPos.CENTER); ). MCVE if needed : import javafx.application.Application; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.ToggleButton; import javafx.scene.layout

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

余生长醉 提交于 2020-02-25 21:41:11
问题 In my JavaFX program I have multiple grid panes. The FXML code I have is here. <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.shape.*?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="553.0" prefWidth="586.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="pkg3dtictactoe

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

≡放荡痞女 提交于 2020-02-25 21:40:32
问题 In my JavaFX program I have multiple grid panes. The FXML code I have is here. <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.shape.*?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="553.0" prefWidth="586.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="pkg3dtictactoe

My messagebox does not work in this GridPane

时间秒杀一切 提交于 2020-01-25 06:50:33
问题 I am taking a GridPane example from an book. The book is not the most recent. When I try to use the Internet I keep getting Scene Builder which is not what I want to use. I am using NetBeans IDE 8.2, and I have 2 problems with this program. Within the btnOk_Click() I am trying to choose Small, Medium, Large AND Thin, Thick . The program puts them in the same group. Also, this MessageBox.show(msg, "Order Details"); //????? may be out dated. The btnCancel_Click() works, but the btnOk_Click()