if(mainWindow.getX() + mainWindow.getWidth() + 470 < screenSize.getWidth()){
x = mainWindow.getX() + mainWindow.getWidth() + 10;
}else if(mainWindow.getX() - 470 > 0){
x = mainWindow.getX() - 460;
}
settingsWindow = new SettingsWindow(new Rectangle(x,150,450,298), settings, this);
}