| Author |
Why doesn't paint
|
Fernando hiar
Greenhorn
Joined: Jan 11, 2008
Posts: 29
|
|
What is wrong with my code!?!?!??!? Why doesn´t paint?!?!?!
I´m using active rendering, thanks...
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Something passes your method a Graphics object. You cast it to Graphics2D. So far so good.
Then you load an image from somewhere, somehow. Then you create a new Graphics2D object and draw the image on it. You never display this Graphics2D object to the user, and you never do anything with the Graphics object which was passed to the method.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8436
|
|
In addition to what Paul said,
Is any piece of your code, calling this method? If all it does is paint(!) why create a new method? The usual recommended way of custom painting is overriding the paintComponent method.
More on custom painting here http://docs.oracle.com/javase/tutorial/uiswing/painting/
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
 |
|
|
subject: Why doesn't paint
|
|
|