-
Bug
-
Resolution: Unresolved
-
P4
-
8u40
-
Linux (kubuntu), Oracle JDK 8u40
On Linux with the Oracle JDK 8u40, Alerts do not correctly resize and long messages will be cut at the end. On Windows, the height of the Alert will be increased such that the message can be displayed correctly.
Screenshots: see https://stackoverflow.com/questions/28937392/javafx-alerts-and-their-size/28938151
Code example:
----------------
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
public class TestAlert extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Alert a = new Alert(AlertType.INFORMATION);
a.setTitle("My Title");
a.setHeaderText("My Header Text");
a.setResizable(true);
String version = System.getProperty("java.version");
String content = String.format("Java: %s.\nThis is a long text. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.", version);
a.setContentText(content);
a.showAndWait();
}
}
Screenshots: see https://stackoverflow.com/questions/28937392/javafx-alerts-and-their-size/28938151
Code example:
----------------
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
public class TestAlert extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Alert a = new Alert(AlertType.INFORMATION);
a.setTitle("My Title");
a.setHeaderText("My Header Text");
a.setResizable(true);
String version = System.getProperty("java.version");
String content = String.format("Java: %s.\nThis is a long text. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.", version);
a.setContentText(content);
a.showAndWait();
}
}
- duplicates
-
JDK-8092843 Content Label will be cut off
- Closed
-
JDK-8087458 [Dialog] JavaFX Alert Dialog can't redraw and resize successfully
- Open
-
JDK-8096780 Alert dialog: Text overrun inconsistency between OS
- Closed