<分区>
我注意到,如果我尝试显示带有长消息的 Alert
,它往往会被截断(在单词边界处)。
例子:
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
public class AlertTest extends Application {
@Override
public void start(final Stage primaryStage) throws Exception {
new Alert(AlertType.INFORMATION, "this is a pretty long message that "
+ "should not be truncated in this alert window, no matter "
+ "how long it is").showAndWait();
}
public static void main(final String... args) {
launch(args);
}
}
这里只显示“这是一条很长的消息,不应该被截断”。
截断的原因是什么,如何避免?
我在 Linux 中使用 Oracle JDK 1.8.0_60。