How to paint outside of paintComponent?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

It depends what you mean and why you need it. For example, it is possible to create a BufferedImage get the Graphics2D object Graphics.paint() everything that should be on the image, then drop the image into a JLabel.

It depends what you mean and why you need it. For example, it is possible to create a BufferedImage, get the Graphics2D object, Graphics.paint() everything that should be on the image, then drop the image into a JLabel. But since I do not know what you are trying to achieve (as opposed to what you are trying to do) I cannot know if that answer solves the unstated problem.

I found out how to solve this issue. What I did was make JPanel an inner class to my JFrame class. In JPanels paintComponent I had it calling a method from the outer class which did some updating of the graphics, by passing paintComponents Graphics2D object.

This has allowed me to paint "outside" of paintComponent, just as I needed.

1 You should NEVER do this. All painting code should be contained in the The paintComponent() method or a child method that is invoked by the paintComponent() method. You should NEVER invoke this child method directly.

If you think you need to do this then you have a wrong design for your program. – camickr May 8 at 15:09.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions