2017-02-04 8 views
0

私はJavaFXの初心者です。私はFXMLを使って基本レイアウトを作成しようとしています。私はBorderPaneで始まり、中央では2つのセクションを作成したいし、HBoxまたはフロー/タイルペインのいずれかを使用しようとしていました。FXFでBorderPaneにJavaFX FlowPaneを挿入

私はそれが可能だ知っている:http://docs.oracle.com/javafx/2/layout/builtin_layouts.htm

しかし、私はFXMLでそれを行う方法がわかりません。私は本当にそれに関する良い情報を見つけるのに苦労している。ここで私はHBoxのにしようとしたものです:

<BorderPane id="main" prefHeight="500" prefWidth="500" xmlns:fx="http://javafx.com/fxml/1" fx:controller="inventorymanagementsystem.FXMLDocumentController">  
    <top> 
     <Label text="Label 1" /> 
    </top> 
    <center> 
     <HBox alignment="LEFT"> 
      <children> 
       <Label text="Label 2" /> 
      </children> 
     </HBox> 
    </center> 
</BorderPane> 

しかし、私はこれらのエラーを取得:

Exception in Application start method 
java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389) 
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767) 
Caused by: java.lang.RuntimeException: Exception in Application start method 
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917) 
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182) 
    at com.sun.javafx.application.LauncherImpl$$Lambda$51/1343441044.run(Unknown Source) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: javafx.fxml.LoadException: 
file:/Users/chelseacamper/NetBeansProjects/InventoryManagementSystem/dist/run174493937/InventoryManagementSystem.jar!/inventorymanagementsystem/FXMLDocument.fxml:18 

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2605) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2583) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2445) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3218) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3179) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3152) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3128) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3108) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3101) 
    at inventorymanagementsystem.InventoryManagementSystem.start(InventoryManagementSystem.java:22) 
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863) 
    at com.sun.javafx.application.LauncherImpl$$Lambda$54/2067027202.run(Unknown Source) 
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326) 
    at com.sun.javafx.application.PlatformImpl$$Lambda$47/355629945.run(Unknown Source) 
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295) 
    at com.sun.javafx.application.PlatformImpl$$Lambda$49/147927901.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294) 
    at com.sun.javafx.application.PlatformImpl$$Lambda$48/1915503092.run(Unknown Source) 
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) 
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at com.sun.javafx.fxml.BeanAdapter.coerce(BeanAdapter.java:509) 
    at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:258) 
    at com.sun.javafx.fxml.BeanAdapter.put(BeanAdapter.java:54) 
    at javafx.fxml.FXMLLoader$Element.applyProperty(FXMLLoader.java:508) 
    at javafx.fxml.FXMLLoader$Element.processValue(FXMLLoader.java:359) 
    at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:321) 
    at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:231) 
    at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:763) 
    at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2827) 
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2536) 
    ... 18 more 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) 
    at com.sun.javafx.fxml.BeanAdapter.coerce(BeanAdapter.java:505) 
    ... 27 more 
Caused by: java.lang.IllegalArgumentException: No enum constant javafx.geometry.Pos.LEFT 
    at java.lang.Enum.valueOf(Enum.java:238) 
    at javafx.geometry.Pos.valueOf(Pos.java:40) 
    ... 38 more 
Exception running application inventorymanagementsystem.InventoryManagementSystem 
Java Result: 1 

任意の提案をいただければ幸いです。

答えて

1

LEFTは、のうち有効な値ではありません.HBoxalignment propertyは、Posを予期しています。必要に応じて"CENTER_LEFT","TOP_LEFT"、または"BOTTOM_LEFT"を使用してください。

+0

ダング、ありがとう。これらの巨大なエラー出力は私が解析するのは難しいです。私はちょうど終わりを最初に見始めるだろうと思う。 – Chelsea

+0

@Chelsea彼らは恐ろしいように見えますが、一度あなたが「テキストの壁」を過ぎ去れば、全体的には非常に簡単です。 [この記事](http://stackoverflow.com/q/3988788/2775450)は、それらを理解する上で非常に便利です。 (そして、はい、その部分の1つは「原因」セクションで分けて、最後から上に向かって作業することです) –

+0

リンクをありがとう! (: – Chelsea

関連する問題