I still have a problem. I'd like to put an image in a JLabel or JButton but every time I load the component,
the component resizes depending on size of the image. My problem is that how you want the image to resize
depending on the size of the button or label.
There is no way we can tell what you are doing wrong based on the code you posted.
Read the JLabel API and follow the link to the Swing tutorial on "How to Use Labels" for working examples. There is also a section on "How to Use Icons", that gives more examples of how to properly read an image.