- 我使用的是jdk1.8.0_151和net beans 8.2以及Scene builder 8.4.1。
虽然我在我的场景中使用字体真棒图标。现场正在加载
第一次缓慢(5-6秒延迟)。虽然我删除了那些
fontawesome图标视图从布局场景即时加载。
使用FontAwesome 8.9。
<?import com.jfoenix.controls.JFXTextArea?>
<?import com.jfoenix.controls.JFXTextField?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane id="AnchorPane" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: #CBE32D;" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="javafxapplication1.FXMLTextsDocumentController">
<children>
<Label alignment="CENTER" layoutX="351.0" layoutY="14.0" prefHeight="17.0" prefWidth="145.0" text="Texts Example" />
<Button fx:id="mainButton" layoutX="648.0" layoutY="31.0" mnemonicParsing="false" onAction="#handleBackToMainButton" prefHeight="25.0" prefWidth="133.0" text="Back To Main" />
<Text fx:id="text1" fontSmoothingType="LCD" layoutX="66.0" layoutY="69.0" onMouseClicked="#handleText1" strokeType="OUTSIDE" strokeWidth="0.0" style="-fx-fill: #7E8F7C;" text="This is example text!" textAlignment="CENTER" wrappingWidth="144.9999988079071">
<font>
<Font name="Calibri Light" size="14.0" />
</font>
</Text>
<TextField fx:id="textFieldName" layoutX="275.0" layoutY="53.0" onKeyReleased="#handleTextField" promptText="Type Name" />
<Label fx:id="textLabelName1" layoutX="449.0" layoutY="57.0" prefHeight="17.0" prefWidth="274.0" textFill="#f50303" />
<JFXTextField fx:id="JFXNumberTextField" layoutX="71.0" layoutY="116.0" promptText="Type number" />
<TextArea fx:id="textAreaAddress" layoutX="250.0" layoutY="94.0" onKeyTyped="#handleTextAreaAddress" prefHeight="87.0" prefWidth="263.0" promptText="Enter Address" />
<JFXTextArea fx:id="JFXTextAreaAddress" layoutX="250.0" layoutY="198.0" onKeyReleased="#handleJFXTextAreaAddress" prefHeight="87.0" prefWidth="285.0" promptText="Enter Comment..." />
<JFXTextField fx:id="JFXTextFieldSearchName" layoutX="247.0" layoutY="341.0" prefHeight="39.0" prefWidth="285.0" promptText="Search Name..." />
<Button fx:id="iconStyleButton" layoutX="87.0" layoutY="367.0" mnemonicParsing="false" onAction="#handleIconStyleButton" text="Icon Style" />
<FontAwesomeIconView fx:id="fABook2" glyphName="BOOK" layoutX="37.0" layoutY="269.0" size="36" />
</children>
</AnchorPane>