I have an application where entering certain numbers changes the data held, I had observers looking at these observables and when they are notified they make changes to what is displayed on screen, one of these is some swing graphics. I do a repaint() in the observer but when I run the app nothing happens until i move the window of the screen and back on again. Is there a way of getting it to actually re draw the window so I can see the changes instantly?
Assuming that you are using an IDE of some sort, put a System.out.println right before the repaint executes to make sure that your repaint is getting called first. I have a hunch that it may not be.
Agree with C Clites; the System.out.println("Calling thisThatOrTheOtherMethod()"); call is a very useful aid to debugging.
You don't say much about your problem; where exactly is your repaint() call? Is it in the sam place as the call to alter the numbers, viz inside your actionPerformed() method?
. . . And what have you got in your paintComponent() method? It ought to start with super.paintComponent(g); as its first statement, otherwise you get the old appearance with the new appearance superimposed.