JDK-8119556 : [CheckBox] Ellipsis is rendered otside of control bounds
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2012-10-12
  • Updated: 2015-06-17
  • Resolved: 2013-04-23
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 8
8Resolved
Related Reports
Blocks :  
Description
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.Separator;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBoxBuilder;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class CheckBoxEllipsis extends Application {

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

    @Override
    public void start(Stage stage) throws Exception {
        
        final double INITIAL_WIDTH = 150.;
        final double MAX_WIDTH = 450.;
        
        VBox vb = new VBox(10d);
        
        final CheckBox cb = new CheckBox();
        cb.setMaxWidth(INITIAL_WIDTH);
        
        String testString = "01234567890qazwsxedcrfvtgbyhnujmikolp";
        String ellipsis = "WWW";
        cb.setText(testString);
        cb.setEllipsisString(ellipsis);
        cb.setStyle("-fx-border-color:blue");
        
        vb.getChildren().addAll(cb, new Separator());
        
        final TextField tfEllipsis = new TextField();
        
        Button btnSetEllipsis = new Button("Set ellipsis string");
        btnSetEllipsis.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent t) {
                cb.setEllipsisString(tfEllipsis.getText());
            }
        });
        
        vb.getChildren().add(HBoxBuilder.create().children(tfEllipsis, btnSetEllipsis).build());
        
        final Label lblCurWidth = new Label("" + INITIAL_WIDTH);
        vb.getChildren().add(lblCurWidth);
        
        ScrollBar scrollBar = new ScrollBar();
        scrollBar.setMin(0);
        scrollBar.setValue(INITIAL_WIDTH);
        scrollBar.setMax(MAX_WIDTH);
        scrollBar.valueProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                cb.setMaxWidth(t1.doubleValue());
                lblCurWidth.setText("" + t1.doubleValue());
            }
        });
                
        vb.getChildren().add(scrollBar);
        
        Scene scene = new Scene(vb, 400, 300);
        stage.setScene(scene);
        stage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
        stage.show();
    }
}

Comments
I'm also unable to reproduce this.
23-04-2013

I'm unable to reproduce this on OS-X with b76
11-02-2013

Rising priority as this is a regression
22-10-2012