A DESCRIPTION OF THE REQUEST :
The Javafx TextArea control lacks an effective means to remove vertical scroll bars. The closest to removing the vertical scroll bar that can be achieved is by setting the scroll bar's opacity to zero. Doing this will make the scroll bar transparent but the vertical scroll bar is still there taking up room but I need to scroll bar totally removed.
JUSTIFICATION :
This enhancement is necessary for applications that require the a multi line editable text control that supports text wrap and has no scroll bars(horizontal and vertical). For example, an application that requires the interface like Windows File Explorer where clicking on a file icon's name will present the user with a control like the one I've just described to allow the user to edit the name of the file.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would like the TextArea be supplied with a method that removes the scroll bars e.g. TextArea.hasScrollBars(boolean hasScrollBars). With the absences of both vertical and horizontal scroll bars, the text in the TextArea will automatically text wrap if the the starts to get wider than the width of the TextArea. In the case where the text outfits the height of the TextArea I would like to see the default behavior be that the TextArea remains the same size and the text be allow to continued to grow inside the TextArea and I would also like to see a method added to the TextArea(for the case where the text outfits the height of the text area) to allow the height of the TextArea to grow as the size of the text get larger.
ACTUAL -
Currently there is not effective means to remove the vertical scroll bar.
---------- BEGIN SOURCE ----------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.TextArea;
import javafx.stage.Stage;
/**
*
* @author adamf
*/
public class JavaApplication2 extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
TextArea textArea = new TextArea("My Test Text area My Test Text area My Test Text area");
textArea.setMinSize(50, 50);
textArea.setMaxSize(50, 50);
//Turning on text wrap to remove horizontal scroll bar.
textArea.setWrapText(true);
primaryStage.setScene(new Scene(textArea));
primaryStage.show();
ScrollBar scrollBar = (ScrollBar) textArea.lookup(".scroll-bar:vertical");
scrollBar.setOpacity(0);
}
}
---------- END SOURCE ----------
The Javafx TextArea control lacks an effective means to remove vertical scroll bars. The closest to removing the vertical scroll bar that can be achieved is by setting the scroll bar's opacity to zero. Doing this will make the scroll bar transparent but the vertical scroll bar is still there taking up room but I need to scroll bar totally removed.
JUSTIFICATION :
This enhancement is necessary for applications that require the a multi line editable text control that supports text wrap and has no scroll bars(horizontal and vertical). For example, an application that requires the interface like Windows File Explorer where clicking on a file icon's name will present the user with a control like the one I've just described to allow the user to edit the name of the file.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would like the TextArea be supplied with a method that removes the scroll bars e.g. TextArea.hasScrollBars(boolean hasScrollBars). With the absences of both vertical and horizontal scroll bars, the text in the TextArea will automatically text wrap if the the starts to get wider than the width of the TextArea. In the case where the text outfits the height of the TextArea I would like to see the default behavior be that the TextArea remains the same size and the text be allow to continued to grow inside the TextArea and I would also like to see a method added to the TextArea(for the case where the text outfits the height of the text area) to allow the height of the TextArea to grow as the size of the text get larger.
ACTUAL -
Currently there is not effective means to remove the vertical scroll bar.
---------- BEGIN SOURCE ----------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.TextArea;
import javafx.stage.Stage;
/**
*
* @author adamf
*/
public class JavaApplication2 extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
TextArea textArea = new TextArea("My Test Text area My Test Text area My Test Text area");
textArea.setMinSize(50, 50);
textArea.setMaxSize(50, 50);
//Turning on text wrap to remove horizontal scroll bar.
textArea.setWrapText(true);
primaryStage.setScene(new Scene(textArea));
primaryStage.show();
ScrollBar scrollBar = (ScrollBar) textArea.lookup(".scroll-bar:vertical");
scrollBar.setOpacity(0);
}
}
---------- END SOURCE ----------