JDK-8199592 : Control labels truncated at certain DPI scaling levels
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 9,10,11
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows
  • CPU: generic
  • Submitted: 2018-03-13
  • Updated: 2018-03-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Unresolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows 10.0.16299.248

A DESCRIPTION OF THE PROBLEM :
In a simple self-sizing scene, some or all control labels are incorrectly truncated with an ellipsis at DPI levels between 100% and 200%. On 125% and 150%, this appears to be fixed by an explicit call to sizeToScene which however should not be necessary, and was not necessary in Java SE 8u60. On 175%, which is also one of the standard Windows 10 scaling levels, the bug persists regardless of calling sizeToScene.

The bug did not appear in several real applications I checked. It seems that increased layout complexity eventually suppresses the bug. There may be an initial text measuring error that eventually gets corrected by additional layout passes.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile below test case and run using -Dglass.win.uiScale=125%, 150%, or 175%. Add parameter "sizeToScene" for calling that method explicitly.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All control labels should always be fully displayed, as the scene is entirely self-sizing without external constraints.
ACTUAL -
On DPI levels of 125%, 150%, or 175% some or all control labels are truncated with an ellipsis. Explicitly calling sizeToScene fixes this for 125% and 150% but not for 175% where all control labels are still truncated.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;

public class ControlLabelTest extends Application {

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void start(Stage stage) {
        final HBox box = new HBox();
        box.setAlignment(Pos.CENTER);
        box.setPadding(new Insets(8));
        box.setSpacing(8);

        for (int i = 0; i < 4; i++)
            box.getChildren().add(new CheckBox("Check"));
        stage.setScene(new Scene(box));
       
        if (getParameters().getUnnamed().contains("sizeToScene"))
            stage.sizeToScene();

        stage.show();
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Explicitly calling sizeToScene appears to suppress the bug at DPI levels other than 175%. Otherwise, only an explicit minimum size for the labeled control works reliably.


Comments
I can reproduce this bug on Windows 7 as well.
2018-03-16

Set System scaling to 100% Issue is reproducible when used command line property -Dglass.win.uiScale with 125%, 150%, 175% values and it's a regression introduced in 9+114. When used runtime parameter 'sizeToScene', issue is not reproducible for scaling less than 175%. WIndows 10, 64-bit JDK results --------------------------------------- 8u172 : Pass 9+113 : Pass 9+114 : Fail 9.0.4 : Fail 11-ea+3 : Fail ------------------------ PFA screenshots - Truncated_label.png & Regression_9+114.png
2018-03-14