How to center image when Jpanel resized?

Either: Easiest way is probably to use a border layout manager and add a Label with an image to the center. The layout manager will take care of changes. If you wish to draw the image manually (eg on paint()) you need to add a component listener and call repaint() on any component size change.

– user63898 Jun 9 '09 at 14:29 Yes, you can, that's the way described in the second paragraph. I'll edit to make it clear it's two different options. – Pool Jun 9 '09 at 14:34 +1 for letting a JLabel handle it for you.

Someone's already done all the hard work. – banjollity Jun 9 '09 at 14:40.

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