3 Replies Latest reply: Apr 23, 2012 12:26 PM by 885691 RSS

    How to attach a text in the center of the Ellipse using JXML ?

    717424
      How to attach a text in the center of the Ellipse using JXML ? Can we use labelFor="$topEllipse" ?

      <StackPane fx:controller="myfxml.ArchiveLogsController" id="Login" xmlns:fx="http://javafx.com/fxml">
      <children>
      <AnchorPane>
      <!-- Prevent AnchorPane so that it's max = pref. This causes it to center in StackPane -->
      <maxWidth><Double fx:value="-Infinity"/></maxWidth>
      <maxHeight><Double fx:value="-Infinity"/></maxHeight>

      <children>
      <Ellipse fx:id="topEllipse" centerX="100" centerY="100" radiusX="50" radiusY="10" strokeWidth="2" stroke="#FF0000" style="-fx-fill: linear-gradient(to right, white 0%, red 100%);"/>
      *<Label fx:id="ArchLogs_lb" text="My Ellipse Label" />*
      </children>
      <properties>
      <backgroundColor>
      <Color blue="1.0" green="1.0" red="1.0" />
      </backgroundColor>
      <elementLockSel>
      <Boolean fx:value="true" />
      </elementLockSel>
      </properties>
      </AnchorPane>
      </children>
      </StackPane>