Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migpane problem with size #77

Open
Hugolarson opened this issue Jun 5, 2020 · 6 comments
Open

Migpane problem with size #77

Hugolarson opened this issue Jun 5, 2020 · 6 comments

Comments

@Hugolarson
Copy link

Hello,
Having used Mig for Swing for many and now am transitioning to JavaFX and have discovered a strange issue how nodes are displayed on differnet computers.

Consider this code;

`public class MigPaneMain extends Application {

@Override
public void start (Stage stage) throws Exception {
        MigPane root = new MigPane();
        Scene scene = new Scene(root);

        Label lbl = new Label("label");
        TextField tf = new TextField();
        VBox box = new VBox(tf, lbl);
        
        root.add(box, "w 200!");
        
        //Button b = new Button("Hello");
        //root.getChildren().add(b);

        stage.setScene(scene);
        stage.setTitle("FX");
        stage.setWidth(1000);
        stage.setHeight(500);
        stage.show();
}

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

}`
Both computer Windows 10. Java-8_181. MipPane. 5.3.

Computer 1. w 200! is not respected

image

Computer 2

image

Let me know if you need debug information.

Br,
Hugo

@mikaelgrev
Copy link
Owner

That is very strange. The only thing I can come to think of is if the textfields are reporting different preferred or maximum sizes.
Try creating the MigPane with new MigPane("debug");
And see the preferred/max size of the textfield with
System.out.println(tf.prefWidth(-1));
System.out.println(tf.maxWidth(-1));
and see of they differ on the computers.

Also, does anything change if the windows are resized (which means the layout will be recalculated)?

Other than that it's hard for me to solve it if it is local to just one computer. Chances are that there's something strange with that computer rather than with MigLayout, but stranger things have happened. :)

@Hugolarson
Copy link
Author

Hugolarson commented Jun 5, 2020

Hi,

Have not rolled out our JavaFX software yet so this might not be isolated problem. Have not seen this problem with swing miglayout on 200 + computers.

Any more ideas?

UPDATED. resize the windows did not do anything. still bad.

Computer 1 (bad)
tf 148.5078125
tf 1.7976931348623157E308
vbox 149.0
vbox 1.7976931348623157E308

image

Computer 2.
tf 186.134765625
tf 1.7976931348623157E308
vbox 187.0
vbox 1.7976931348623157E308

image

@mikaelgrev
Copy link
Owner

mikaelgrev commented Jun 5, 2020

I JavaFX running with MigLayout on multiple computers at customers and a lot of on Windows, so I don't think this is a general problem. MigLayout also have quite a large user base, so it it was a generic problem I think I would have heard about it, or at least I hope so. :)
No further ideas unfortunately other than to try with a newer Java version to see if there is something in JavaFX.

@Hugolarson
Copy link
Author

Hugolarson commented Jun 5, 2020

Strange that this same computer Mig works fine with swing but not JavaFX. Same Java version.

@mikaelgrev
Copy link
Owner

It is strange indeed.

@Hugolarson
Copy link
Author

Hello,
We have now observed this issue on several other computers.
Here is one example of a modern computer
https://www.asus.com/Laptops/X540LA/
Tried as you suggested with newer java 8-252 from Azul
https://www.azul.com/downloads/zulu-community/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jre-fx

If you want we can give you access to this laptop or provide you with debug information.

Please address this issue of your great library.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants