title: Insert image into borderpane as background
body: <p>I want to load image into BorderPane. I have a static Java method which makes this task more complicated for me:</p>
  
  <pre><code>private static final Image iv;    
      static {
          iv = new Image(StartPanel.class.getClass().getResource("/images/system-help.png").toExternalForm());
      }
  
  public static void insert(){
  
       bp.setCenter(iv);
  }
  </code></pre>
  
  <p>Can you tell me how I can load the image properly?</p>
  
  <p>P.S I get this </p>
  
  <pre><code>Executing com.javafx.main.Main from /home/rcbandit/Desktop/test/DX-57DC/dist/run1833589211/DX-57DC.jar using platform /opt/jdk1.7.0_25/bin/java
  Exception in Application start method
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.javafx.main.Main.launchApp(Main.java:642)
      at com.javafx.main.Main.main(Main.java:805)
  Caused by: java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
      at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
      at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
      at java.lang.Thread.run(Thread.java:724)
  Caused by: java.lang.NullPointerException
      at com.dx57dc.stages.StartPanel.infrastructureIcon(StartPanel.java:241)
      at com.dx57dc.stages.StartPanel.navigationPanel(StartPanel.java:138)
      at com.dx57dc.stages.StartPanel.agentsPanel(StartPanel.java:78)
      at com.dx57dc.stages.Agents.agentsPanel(Agents.java:9)
      at com.dx57dc.main.DX57DC.initMainStage(DX57DC.java:287)
      at com.dx57dc.main.DX57DC.start(DX57DC.java:115)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
      ... 1 more
  Java Result: 1
  </code></pre>
  
  <p>P.S 2
  I managed to load the image with this code:</p>
  
  <pre><code>    private static final ImageView iv;    
          static {
              iv = new ImageView(StartPanel.class.getResource("/com/dx57dc/images/6.jpg").toExternalForm());
          }
  
  borderpane.setCenter(iv);
  </code></pre>