March 6th, 2012, 02:45 AM
I suppose my answer lies in a better understanding of paintComponent(graphics g); But, I'll ask it here just incase someone has a direction to point me in I would much appriciate it.
You see I have some images I want to update at different times. So I need a way of only calling to update certain images. I tried using a layeredPane and, just using another component. But, either way they seem to be called if I update the paint it looks somethign like this.
bUttonLogic.need = false;
JComponent game = new gameEngine(gameEngine.NEW_GAME);
JComponent gme = new typeO();
gAme = game;
This code below some how still calls to update the overriden paintComponent in typeO class.
Thanks ahead of time.
I am now trying to use printComponent for the other images seems rather inefficeint but, I'm still toying around with how the graphics class is called. I still don't quite understand how the graphics class is called/works.
I now realize that when I add two components one after another it jsut overrides the previous. I think.
Last edited by kolt007; March 6th, 2012 at 03:28 AM.
March 6th, 2012, 12:26 PM
Stop writing code and read a tutorial on how Swing handles painting components. There are many articles available if you search but the following is a pretty good one http://java.sun.com/products/jfc/tsc/articles/painting/
It's pointless trying to solve your problem unless you understand how the system works.
I can't offer more help as you haven't really explained what your problem is.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!