-
Bug
-
Resolution: Unresolved
-
P4
-
8u20
-
Windows 7
When you view the document file of about 400KB of Japanese in high DPI environment, operation (Select Text, Scroll, Ins, Del, etc) response is very slow.
Font size in the following test code I found that a significant impact on TextArea of performance.
test code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class TextAreaTest extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane pane = new StackPane();
TextArea textArea = new TextArea();
textArea.setWrapText(true);
StringBuilder buf = new StringBuilder();
String alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
String number = "0123456789";
String testchar = alpha + number;
for(int i=0; i<100000; i++){
buf.append(testchar.charAt(i%testchar.length()));
if(i>0 && i%100 == 0){
buf.append("\n");
}
}
textArea.setFont(Font.getDefault().font(120.0));
// textArea.setFont(Font.getDefault().font(60.0));
// textArea.setFont(Font.getDefault().font(20.0));
// textArea.setFont(Font.getDefault().font(12.0));
textArea.setText(buf.toString());
pane.getChildren().add(textArea);
Scene scene = new Scene(pane);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
Font size in the following test code I found that a significant impact on TextArea of performance.
test code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class TextAreaTest extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane pane = new StackPane();
TextArea textArea = new TextArea();
textArea.setWrapText(true);
StringBuilder buf = new StringBuilder();
String alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
String number = "0123456789";
String testchar = alpha + number;
for(int i=0; i<100000; i++){
buf.append(testchar.charAt(i%testchar.length()));
if(i>0 && i%100 == 0){
buf.append("\n");
}
}
textArea.setFont(Font.getDefault().font(120.0));
// textArea.setFont(Font.getDefault().font(60.0));
// textArea.setFont(Font.getDefault().font(20.0));
// textArea.setFont(Font.getDefault().font(12.0));
textArea.setText(buf.toString());
pane.getChildren().add(textArea);
Scene scene = new Scene(pane);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}