-
Bug
-
Resolution: Fixed
-
P3
-
9
-
x86_64
-
linux_ubuntu
FULL PRODUCT VERSION :
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+171)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+171, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux revilloud-Z97X-Gaming-5 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
It seems that the stage don't take correctly into account the size with a setHeight and probably with the setWidth on a stage.
The documentation of setWidth says:
"The width of this Window. Changing this attribute will narrow or widen the width of the Window. This value includes any and all decorations which may be added by the Operating System such as resizable frame handles..."
But in fact, the size of the stage is larger than the size of the windows.
REGRESSION. Last worked in version 8u131
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program with java 9 and get:
506.0
Run the program with java 8 and get:
506.0
480.0
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
We are expecting to get the height of the stage equal to 480
ACTUAL -
We get a stage size of 506
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.stage.Stage;
public class Size extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
arg0.setWidth(640);
arg0.setHeight(480);
arg0.heightProperty().addListener((p, old, _new) -> System.out.println(_new));
arg0.show();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
public class Size extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
new Thread(() -> {
try {
Thread.sleep(100);
Platform.runLater(() -> {
arg0.setWidth(640);
arg0.setHeight(480);
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
arg0.setWidth(640);
arg0.setHeight(480);
arg0.heightProperty().addListener((p, old, _new) -> System.out.println(_new));
arg0.show();
}
}
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+171)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+171, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux revilloud-Z97X-Gaming-5 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
It seems that the stage don't take correctly into account the size with a setHeight and probably with the setWidth on a stage.
The documentation of setWidth says:
"The width of this Window. Changing this attribute will narrow or widen the width of the Window. This value includes any and all decorations which may be added by the Operating System such as resizable frame handles..."
But in fact, the size of the stage is larger than the size of the windows.
REGRESSION. Last worked in version 8u131
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program with java 9 and get:
506.0
Run the program with java 8 and get:
506.0
480.0
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
We are expecting to get the height of the stage equal to 480
ACTUAL -
We get a stage size of 506
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.stage.Stage;
public class Size extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
arg0.setWidth(640);
arg0.setHeight(480);
arg0.heightProperty().addListener((p, old, _new) -> System.out.println(_new));
arg0.show();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
public class Size extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
new Thread(() -> {
try {
Thread.sleep(100);
Platform.runLater(() -> {
arg0.setWidth(640);
arg0.setHeight(480);
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
arg0.setWidth(640);
arg0.setHeight(480);
arg0.heightProperty().addListener((p, old, _new) -> System.out.println(_new));
arg0.show();
}
}