I'm using a self-made DesktopPaneUI for a JDesktopPane, I've written the proper methods for the class, and I'm running into trouble. When I resize the JDesktopPane, the background image doesn't resize with the frame. The image appears to be clipped at the size it was when the window initially opened. I'm giving it an image larger than the window, and I'm still having this problem.
Here's my method call inside the constructor of my desktopUI class.
super();
this.background = javax.imageio.ImageIO.read(new File(fileName));
Is there a way I can change my main class where I set the UI, or the myDesktopPaneUI class such that the background still fills the window when the JDesktopPane changes size?
setUI(new myDesktopPaneUI("media/bg.jpg"));