Can you change where JLabel paint their icons?
In my program I have an image that is too large for the JLabel I want to put it in, so it will show only the middle, which is fine since this JLabel is suppose to magnify the image, only I also need to move this image to see different parts of it. Sooo I was thinking an easy way to do this would be to just have the icons top left point start somewhere else so a different part of the image will be in the JLabel.
Only I cant find a way to do this. Anyone know ifthis can be done?
This is what it does right now when I use the code:
| image |
| ----- |
| |Lable| |
| ------ |
So pretty much i give it a large image and then shrink the JLable to a smaller size, but then it shows only the middle. Is there a way to move around where the image is painted so a different part shows up in the label?
JLabel newLabel = new JLabel(newImage);
Thank You for any ideas