Results 1 to 1 of 1
  1. #1
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Rep Power

    Default how to work with Textfield in javafx (scene builder)


    i have some textfield in my stage. so i want to get values from textfilds.will u help me plz?

    Java FX Code:
     public class FXMLBookController implements Initializable {
    public void txt(){
    public void initialize(URL url, ResourceBundle rb) {
    // TODO

    my Fxml File ::

    Java FX Code:
        <?xml version="1.0" encoding="UTF-8"?>
    <?import javafx.scene.text.*?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <AnchorPane id="AnchorPane" prefHeight="512.0" prefWidth="600.0" xmlns:fx="" xmlns="" fx:controller="javafxtest.FXMLBookController">
    <Button layoutX="191.0" layoutY="446.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="133.0" text="ثبت">
    <Font name="2 Elham" size="24.0" />
    <TextField layoutX="146.0" layoutY="49.0" />
    <Label layoutX="458.0" layoutY="51.0" prefHeight="21.0" prefWidth="110.0" text=": کد بین المللی">
    <Font name="2 Elham" size="21.0" />
    <Label layoutX="513.0" layoutY="135.0" text=": عنوان">
    <Font name="2 Elham" size="21.0" />
    <Label layoutX="495.0" layoutY="209.0" text=": نویسنده">
    <Font name="2 Elham" size="21.0" />
    <Label layoutX="513.0" layoutY="285.0" text=": قیمت">
    <Font name="2 Elham" size="21.0" />
    <Label layoutX="515.0" layoutY="356.0" text=": گروه">
    <Font name="2 Elham" size="21.0" />
    <TextField fx:id="txtfiled" layoutX="146.0" layoutY="131.0" />
    <TextField layoutX="146.0" layoutY="207.0" />
    <TextField layoutX="146.0" layoutY="281.0" />
    <TextField layoutX="146.0" layoutY="354.0" />
    Last edited by M0TRIX; 12-07-2014 at 08:06 PM.

Similar Threads

  1. Replies: 2
    Last Post: 10-14-2014, 05:20 PM
  2. JavaFX scene builder
    By JavaPete in forum JavaFX
    Replies: 2
    Last Post: 07-17-2014, 01:23 AM
  3. JavaFX Book | Learn JavaFX More In Depth
    By SnakeDoc in forum JavaFX
    Replies: 0
    Last Post: 05-18-2013, 12:10 AM
  4. JavaFX Script and JavaFX Mobile
    By levent in forum Java Software
    Replies: 1
    Last Post: 01-27-2010, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts