Hi, as the topic follows im trying to repaint a window from another class. the class Window handles an interface that displays pictures of movies. Via a JMenuBar you can add a new movie and its picture but in order for it to show in the Window i need to repaint certain aspects in the Window class GUI;
The window class constructor:
public Window() { addComponents(); configurFrame(); addMenu(); }
The functions i want to repaint:
public void repaintWindow() { this.getContentPane().validate(); this.getContentPane().repaint(); }
From my other class where i add a movie to an ArrayList i have made a "private Window myWindow;" there i call the function repaintWindow via mywindow.repaintWindow(); But this gives me an NullPointerException related to the repaintWindow function.
Any suggestions?