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

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

    hello

    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 {
    
    @FXML
    public void txt(){
    
    
    }
    
    @Override
    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="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="javafxtest.FXMLBookController">
    <children>
    <Button layoutX="191.0" layoutY="446.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="133.0" text="ثبت">
    <font>
    <Font name="2 Elham" size="24.0" />
    </font>
    </Button>
    <TextField layoutX="146.0" layoutY="49.0" />
    <Label layoutX="458.0" layoutY="51.0" prefHeight="21.0" prefWidth="110.0" text=": کد بین المللی">
    <font>
    <Font name="2 Elham" size="21.0" />
    </font>
    </Label>
    <Label layoutX="513.0" layoutY="135.0" text=": عنوان">
    <font>
    <Font name="2 Elham" size="21.0" />
    </font>
    </Label>
    <Label layoutX="495.0" layoutY="209.0" text=": نویسنده">
    <font>
    <Font name="2 Elham" size="21.0" />
    </font>
    </Label>
    <Label layoutX="513.0" layoutY="285.0" text=": قیمت">
    <font>
    <Font name="2 Elham" size="21.0" />
    </font>
    </Label>
    <Label layoutX="515.0" layoutY="356.0" text=": گروه">
    <font>
    <Font name="2 Elham" size="21.0" />
    </font>
    </Label>
    <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" />
    </children>
    </AnchorPane>
    Last edited by M0TRIX; 12-07-2014 at 07:06 PM.

Similar Threads

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