Am new be in java and i wan to standarelize image as banner ,the image am using is big to get optimal quality,and i wan to create JPanel extended class to use it in the diffrent JFrames with this image in background.
so i must scale it i'v tried many examples but i down't know how exately i should use BufferedImage,and AffineTransform,and paintComponent.
If you want the image to fill the entire background then you can check out Background Panel for example code. This uses dynamic painting and does not keep the width/height aspect ratio.
... and if you're using the JPanel only to display an image (that is, you're not adding any other components to it) you can user a JLabel instead, with a StretchIcon or ShrinkIcon. You can find those classes on the site linked by Rob.
luck, db
There are no new questions, but there may be new answers.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss