I have a Java Swing app with some javaFX features. I am using Java 8.
I have some troubles with "scale and layout settings", if the "size of text, apps and other items" is 100% everything works fine. But if the percentage is 150% (which is the recommended size for my pc) as soon as this instruction is run:
PlatformImpl.startup
It seems that the "internal layout" of my app changes to 100%.
Is there anyone with the same problem? Is there a way to set the scale percentage (and maybe a way to retrieve it beforehand)?
EDIT:
I am using the latest jre/jdk 8 available (1.8 update 311)
Here is a minimal reproducible example:
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import com.sun.javafx.application.PlatformImpl;
import javafx.application.Platform;
public class JavaFXTest {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton btn = new JButton();
btn.addActionListener(e ->
//This is the culprit
PlatformImpl.startup(() -> System.out.println("javaFX started"))
);
JPanel panel = new JPanel();
JLabel label = new JLabel("Some character for testing");
panel.add(btn);
panel.add(label);
frame.getContentPane().add(panel);
// Display the window.
frame.pack();
frame.setVisible(true);
}
}