2014-11-24 19 views
0

我遇到了我的JavaFX TextArea問題。我使用FXCanvas將一些JavaFX控件嵌入到SWT組合中。除了TextArea之外,一切正常,不允許我通過拖動來突出顯示文本。雙擊和「右鍵單擊」/「全選」工作正常,所以文本選擇工作。嵌入式JavaFX到SWT中的文本選擇問題

我的對象是在一個FXML文件中定義的,你不能做任何事情簡單:

<Accordion fx:id="accordion" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.kratos.birt.report.data.oda.kairosdb.ui.FXMLController"> 
    <panes> 
    <TitledPane fx:id="builderPane" text="Query Builder"> 
     ... 
    </TitledPane> 
    <TitledPane fx:id="jsonPane" text="Raw Query"> 
     <content> 
      <VBox> 
       <children> 
        <Label text="Enter your query:"> 
        <VBox.margin> 
         <Insets bottom="5.0" /> 
        </VBox.margin> 
        </Label> 
        <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> 
        <children> 
         <TextArea fx:id="queryArea" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> 
        </children> 
        </AnchorPane> 
       </children> 
      </VBox> 
     </content> 
    </TitledPane> 
    </panes> 
</Accordion> 

我沒有做任何修改就可以在代碼中,除了設置一些文字。如果TextArea不在Accordion容器中,則拖動選擇不起作用。

回答

0

我找到的解決方案是將JRE的版本(以及因此JavaFX的版本)從8降級到7.