How to set constraint On the Image so that Image should not spills out JFrame Window
Asked
Active
Viewed 55 times
1 Answers
1
To alter the size of your image you can crop or resize (scale) your image. The sizes to which resize your image's can be get from the size of the frame.
If you have a frame
JFrame frame = new JFrame();
frame.setVisible(true);
you can get frame's size:
Dimension windowSize = frame.getContentPane().getSize();
System.out.println(windowSize);

Community
- 1
- 1

Developer Marius Žilėnas
- 5,813
- 1
- 41
- 70