2
我正在尝试使用JavaFX 2.0
创建TextBox
。 我的来源如下:TextBox中的新行(JavaFX 2.0)
TextBox textBox = new TextBox();
textBox.setPrefSize(150, 600);
textBox.setText("Hello\n world!");
结果是:
我怎么能创造TextBox
新的生产线?
我正在尝试使用JavaFX 2.0
创建TextBox
。 我的来源如下:TextBox中的新行(JavaFX 2.0)
TextBox textBox = new TextBox();
textBox.setPrefSize(150, 600);
textBox.setText("Hello\n world!");
结果是:
我怎么能创造TextBox
新的生产线?
创建多线TextBox是JavaFX 1.3的一个特性。在JavaFX 2.0中,你必须使用TextArea。
TextArea textArea = new TextArea();
textArea.setPrefRowCount(2);
textArea.setText("Hello\nworld!");
的JavaFX UI Controls教程没有提到TextArea控件。也许他们错过了什么。正如你在这篇JavaFX 1.3 TextBox教程中看到的,TextBox有一个'多行'和'行'属性。 JavaFX 1.3没有TextArea。