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
容器中,則拖動選擇不起作用。