JavaFX Alert会截断邮件吗?
发布时间:2020-12-15 04:47:03 所属栏目:Java 来源:网络整理
导读:参见英文答案 JavaFX Alerts and their size????????????????????????????????????4个 我注意到,如果我尝试用长消息显示警报,它往往会被截断(在单词边界). 例: import javafx.application.Application;import javafx.scene.control.Alert;import javafx.sce
参见英文答案 >
JavaFX Alerts and their size????????????????????????????????????4个
我注意到,如果我尝试用长消息显示警报,它往往会被截断(在单词边界). 例: 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. 解决方法
我认为这只是一个Windows和Linux问题.它不会发生在MacOS上.但是我认为这将在所有平台上为您解决.
Alert alert = new Alert(AlertType.INFORMATION); alert.setContentText("this is a pretty long message that " + "should not be truncated in this alert window,no matter " + "how long it is"); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alert.showAndWait(); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |