JDK-8112995 : HBox wrong layout with BASELINE_LEFT alignment
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-06-13
  • Updated: 2015-06-16
  • Resolved: 2011-11-11
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.
Other
fx2.1Fixed
Related Reports
Relates :  
Description
HBox is created as following:

    private Parent createTopBar() {
        final HBox box = new HBox(2.0);
        box.setAlignment(Pos.BASELINE_LEFT);
        
        final TextBox nameInput = new TextBox(20);
        final PasswordBox passwordInput = new PasswordBox();
        final Button loginCmd = new Button("Log In...");
        
        
        final ProgressBar progressView = new ProgressBar(0.0);
        final Label label1 = new Label("Name:");
        final Label label2 = new Label("Password:");
        
        box.getChildren().addAll(
                label1,
                nameInput, 
                label2,
                passwordInput,
                loginCmd,
                progressView
                        );
        return box;
    }


The resulting layout is broken as shown at the attached screenshot.
Comments
Verified for 2.1 b14
24-02-2012

Attaching a screen shot from our latest mac build and everything seems to be working.
26-01-2012

Please file a new issue attached with your testcase for the setAlignment() bug. Thanks
26-01-2012

The problem exists on the Mac preview release. In addition, note that setStyle("-fx-alignment: baseline-left;") DOES work--it's only setting with setAlignment that fails (in the few instances I've looked at).
24-01-2012

I have provided a new screenshot with the window decoration, to make sure it is windows 7 OS and full example to reproduce the problem. Please check it in a proper environment. It should be windows 7. Thanks.
28-06-2011

Full example
28-06-2011

Windows7 64
28-06-2011

And one important note. The layout can fixes when one makes mouse gestures over the window. Probably You have done something like this and didn't notice broken layout.
28-06-2011

I see your point, but I can reproduce it with provided code in 2 different environments. I'm going to check last javafx build.
28-06-2011

When I run the attached code by putting the HBox in a BorderPane's top position, baseline seems to work fine (see second image). To investigate further I would need a reproducible test case.
28-06-2011