I have a javaFX application with fxml file. I don't understand how I can adapt to other screens. That is, I have 1920x1080 and the application is in full screen, and at 1366x768 it cuts it almost 2 times.
My startup class:
public class FrameStart extends Application {
static Logger LOGGER;
static {
try(FileInputStream ins = new FileInputStream("src/main/resources/log.config")) {
LogManager.getLogManager().readConfiguration(ins);
LOGGER = Logger.getLogger(FrameStart .class.getName());
} catch (IOException e) {
LOGGER.log(Level.WARNING,"Error ", e);
}
}
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) {
try {
FXMLLoader loader = new FXMLLoader();
URL xmlUrl = getClass().getResource("/Scene.fxml");
loader.setLocation(xmlUrl);
Parent root = loader.load();
stage.setTitle("App");
stage.getIcons().add(new Image(FrameStart .class.getClassLoader().getResourceAsStream("logo.png")));
stage.setScene(new Scene(root));
stage.show();
} catch (Exception e) {
LOGGER.log(Level.SEVERE,"Error", e);
}
}
}
I don't really understand how to adapt