Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can not set javafx.scene.control.TextField field to javafx.scene.control.Button

1047685Oct 16 2013 — edited Oct 16 2013

Hello all

I'm having issues with trying to track down an error that I'm experiencing. Currently I'm working to include fxml data within a parent fxml file (as outlined in this thread), and I keep running into the error mentioned above. Now within this fxml file that I'm attempting to include, Here's the code for the fxml file in question

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>

<?import javafx.geometry.*?>

<?import javafx.scene.control.*?>

<?import javafx.scene.image.*?>

<?import javafx.scene.layout.*?>

<?import javafx.scene.layout.AnchorPane?>

<?import javafx.scene.layout.HBox?>

<?import javafx.scene.layout.VBox?>

<?import javafx.scene.text.*?>

<AnchorPane fx:id="textAreaAnchorPane" padding="$x1" prefHeight="177.0" prefWidth="918.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="com.package.childScreenController">

  <VBox alignment="CENTER" layoutX="15.0" layoutY="16.0" prefHeight="147.0" prefWidth="889.0">

    <children>

      <Text text="Choose your play type" textAlignment="CENTER" textOrigin="CENTER">

        <font>

          <Font size="28.0" />

        </font>

      </Text>

      <HBox alignment="TOP_CENTER" prefHeight="100.0" prefWidth="200.0">

        <children>

          <Button fx:id="firstButton" mnemonicParsing="false" onAction="#handleFirstButton" text="1 - First Button">

            <font>

              <Font size="16.0" fx:id="x2" />

            </font>

            <HBox.margin>

              <Insets bottom="15.0" left="15.0" right="15.0" top="15.0" fx:id="x1" />

            </HBox.margin>

          </Button>

          <Button fx:id="secondButton" font="$x2" mnemonicParsing="false" onAction="#handleSecondButton" text="2 - Second Button" HBox.margin="$x1" />

          <Button fx:id="thirdButton" font="$x2" mnemonicParsing="false" onAction="#handleThirdButton" text="3 - Third Button" HBox.margin="$x1" />

          <Button fx:id="fourthButton" font="$x2" mnemonicParsing="false" onAction="#handleFourthButton" text="4 - Fourth Button" HBox.margin="$x1" />

        </children>

      </HBox>

    </children>

  </VBox>

</AnchorPane>

What's throwing me is that I have no textField element, nor anything that would have a reference "field", at least that I'm seeing. Hence confused as to the source of this error, and how to resolve. Anyone happen to know more about this possible issue?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2013
Added on Oct 16 2013
3 comments
5,262 views