- Feb 17, 2002
- 4,723
- 80
- 91
So I'm just trying to hack together a little proof of concept app. It involves drawing directly to a JFrame. Everything works just fine, except in order to actually see the shapes I've drawn, I need to drag the window off the screen, then bring it back. Since 99.9% of all the programming I've ever done in any language has not involved a GUI, I'm a bit perplexed. Also, I haven't touched Java in 4 years, so I forgot all the intricacies of it. I'm missing something stupid...
Obviously this has something to do with refreshing/redrawing/whatever the window. I'm not quite sure how to properly attack this problem. Unfortunately, I'm not allowed to show you my source code. I can say this: I'm using the NetBeans IDE. I just made a JFrame and added a menu bar to it. When one of the menu items is clicked, my code draws something directly to the frame (under the menu bar). That's about it - nothing special. I do my drawing in the overrode paint(Graphics g) method.
Any ideas?
Obviously this has something to do with refreshing/redrawing/whatever the window. I'm not quite sure how to properly attack this problem. Unfortunately, I'm not allowed to show you my source code. I can say this: I'm using the NetBeans IDE. I just made a JFrame and added a menu bar to it. When one of the menu items is clicked, my code draws something directly to the frame (under the menu bar). That's about it - nothing special. I do my drawing in the overrode paint(Graphics g) method.
Any ideas?