Java: maintaining aspect ratio of JPanel background image
问题 I have a JPanel with a painted background image and a layout manager holding other smaller images, all of this inside a JFrame . The background image is pretty big and I want to be able to have it maintain its aspect ratio whether its on a big or small monitor. Eventually, I want to be able to have my LayoutManager and the smaller images in its cells \"glued\" to the background picture. I looked around for resources and it seems that many examples use a BufferedImage but I am not; will this