resizing a graphic inside a JPanel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nt5515
    New Member
    • Feb 2008
    • 10

    #1

    resizing a graphic inside a JPanel

    Hi
    I've set up an array of Jpanels in a grid layout. im trying to insert a graphic into each panel using a loop. i can get the graphic in but it sits in the bottom right of each panel, and i've tried setting the layout and the size but nothing happens.

    Is there any way which i can set the graphic to be the same size as the JPanel, so when i resize the window the graphic will resize automaticaly.

    Any ideas??
    Cheers
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Originally posted by nt5515
    Hi
    I've set up an array of Jpanels in a grid layout. im trying to insert a graphic into each panel using a loop. i can get the graphic in but it sits in the bottom right of each panel, and i've tried setting the layout and the size but nothing happens.

    Is there any way which i can set the graphic to be the same size as the JPanel, so when i resize the window the graphic will resize automaticaly.

    Any ideas??
    Cheers
    By graphic, do you really mean java.awt.Image or subclass BufferedImage?

    Comment

    Working...