Link to home
Start Free TrialLog in
Avatar of pdlarue
pdlarue

asked on

Error in getSize() getter - creating a size property that is an int array of height and width

Experts:

I'm trying to create a size property that is an int array of height and width:

      private int [] size = new int [2];

      public int [] getSize() {  // getSize() is underlined in red "here is my error"
            size[0] = height;
            size[1] = width;
            return size;
      }

      public void setSize(int h, int w) {
            height = h;
            width = w;
      }

When I hover the cursor over the getSize() it pops up the following message:  
The return type is incompatible with Component.getSize()

I've gone through all of my code looking for incompatibilities and I can't find any.  So, I'm beginning to think there is something wrong with my syntax.

Any ideas?
Thanks,
Patricia
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)