1

When I am using Jframe, resizing a window enter image description here

When I click resize button:

enter image description here

Image are all go to the left side of window, that's not what I want

How can I let my image automally fit with window like this:enter image description here

Andrew Thompson
  • 166,747
  • 40
  • 210
  • 420
Cflowe Visit
  • 275
  • 1
  • 8
  • 1
    For [example](https://stackoverflow.com/questions/11959758/java-maintaining-aspect-ratio-of-jpanel-background-image/11959928#11959928); [example](https://stackoverflow.com/questions/25798156/resizing-icon-to-fit-on-jbutton-in-java/25798462#25798462); [example](https://stackoverflow.com/questions/12876615/how-do-i-resize-images-inside-an-application-when-the-application-window-is-resi/12876799#12876799); [example](https://stackoverflow.com/questions/14548808/scale-the-imageicon-automatically-to-label-size/14553003#14553003) – MadProgrammer Apr 05 '22 at 21:33
  • @DevilsHnd but in example they are all use Jpanel but I didn't use Jpanel, I am using 100% Jframe – Cflowe Visit Apr 06 '22 at 06:11
  • @DevilsHnd but that helps me, I find out a similar way, and thanks for that :) – Cflowe Visit Apr 06 '22 at 06:17

0 Answers0