problem with textarea in javafx?
I used textarea in javafx 2.0 but i n开发者_运维知识库eed to add it scrolpane.how can i do that?
Scrolllpane s = new Scrollpane();
s.setnode(textarea);
but when i click on scroll pnane it has doesn't move. what is problem?
setNode() is the right method to call to set the node that the ScrollPane will scroll over. I've used ScrollPane extensively in my 2.0 app, but I have not tried it on Text Area. Based on the API documentation for TextArea (http://download.oracle.com/javafx/2.0/api/com/javafx/preview/control/TextArea.html) it sounds like it has its own built in scroll bars? I would try setting the width/height of the TextArea, and also set the max width/height, and see if you can trigger scrollbars to appear automatically when the lines in the text area exceed the available space.
If you still want to put it in a ScrollPane, perhaps with some other nodes, you should use a container node such as VBox or something to wrap the TextArea, then set the VBox to be your scroll node on ScrollPane.
Also, bear in mind that TextArea is not a committed control for FX 2.0 yet and is therefore less hardened than the other FX controls.
When we create a text area, scroll bar automatically appears when it goes beyond t
精彩评论