Monday 9 December 2019

Java: Image appearing very small in JPanel

So I have an image being drawn inside a JPanel which itself is added to a JFrame. However when the Image is first drawn it appears to be very small. I'm not sure if this is a problem with the panel or a problem with the image. It is illustrated below:
![enter image description here][1]



I have drawn a rectangle around the image.



Now the JPanel is supposed to be contained within the JFrame. The JFrame is not supposed to be coloured in as is seen above. The JPanel is meant to be about a quarter of the size of the JFrame and the image is supposed to take up almost all of the JPanel.



Could you please tell me if it's the image which is the problem or the Panel. Sorry if it seems obvious.



Awaiting SSCCE

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...