This content has been marked as final. Show 5 replies
tanvir ahmed wrote:You probably want to use a GridPane for this, with one row of Labels for the headers and rows of TextFields below. There's a [url http://docs.oracle.com/javafx/2/layout/builtin_layouts.htm]tutorial for the layout panes.
Pls answer that
I want to create a data entry from which contains a row with 5 columns like this
sr# partyCode partyName particulars amount
Now I want that when i enters values in this row and press enter key then a new row is created automatically and I want sr# value to start from 01 and increase automatically too after every enter key pressing.Just create a controller (see [url http://docs.oracle.com/javafx/2/fxml_get_started/fxml_tutorial_intermediate.htm]this part of the tutorial) and register the appropriate listeners ([url http://docs.oracle.com/javafx/2/events/convenience_methods.htm]tutorial) with your text fields to add new items to the grid pane as necessary.
Sir James !
Thanks for your reply.
You understand my question exactly right.
But I forget to tell that i want to get this all with scene builder, where I am confused that how to create next row in gridPane automatically.
Select the GridPane and go to "Layout" on the right side of Scene Buider, you should see the options of adding rows/columns.
Dear thanks for your reply!
But I dont find any option for automtic adding of rows in gridPane
SceneBuilder is a tool for generating FXML.1 person found this helpful
FXML can only define a static user interface. Code to change the user interface in response to user input, which is what I assume you mean by "automatic row insertion", must be written in another language (not FXML); this is typically Java code and is placed in the controller. (It's possible to do this using other JVM languages, such as Groovy, but Java is by far the most common.)
So you need to write a controller. Use SceneBuilder to map the fxml file to a controller, and put the code to add new rows into the controller.