title: libgdx loading preferences for LwjglApplicationConfiguration
body: <p>I am using <a href="https://github.com/libgdx/libgdx/wiki/Preferences" rel="nofollow noreferrer">preferences</a> from libgdx. I have stored width and height keys with values in ../prefs/MyPreferences file.</p>
  <p>In my DesktopLauncher main method, I am doing following configuration before starting new LWJGL App:</p>
  <pre><code>private static void main() {
      LwjglApplicationConfiguration desktopConfiguration = new LwjglApplicationConfiguration();
      Preferences preferences = new Preferences(&quot;MyPreferences&quot;);
      desktopConfiguration.title = &quot;My Game&quot;;
      desktopConfiguration.width = preferences.getInteger(&quot;width&quot;);
      desktopConfiguration.height = preferences.getInteger(&quot;height&quot;);
      new LwjglApplication(new Game(preferences), desktopConfiguration);
  }
  </code></pre>
  <p>I am getting NPE, and reason is because application is not loaded yet in order to use this preferences.
  So my question is, how can I fill configuration properties such as width,height,etc. by loading values from preferences if preferences is not loaded first?</p>