Hey! I got two classes here, one that does stuff with an image and one class utilizing the other class. So inside my picture class I have an Image object and in my other class I want to have a JFrame and I want to set the size of the frame to the size of the picture... So inside my picture class I tried creating two methods, getX and getY that returns
int methodX(){return picture.getWidth(this);
alternatively with null in the argument:
int methodX(){return picture.getWidth(null)
but when I call these methods from my other class with a System.out.print(just to check the value) it returns -1.
What would be the proper way to get the pixel size of the image?