Hi together- it's me again.
I've got another problem now- it seems to be a never ending story... ;-)
In the constructor of the class "Piano" I have this code:
I am asked to replace the numbers, e.g.
I have to replace 63 by Key.getImage().getWidth()
But if I write it in my code it says:
/** * Make the piano. */ public Piano() { super(800, 340, 1); makeKeys(); } /** * Makes keys. */ public void makeKeys() { int i=0; while (i<12) { addObject(new Key("g", "3g.wav"),i*63+54,140); i=i+1; } }
non-static method getImage() cannot be referenced from a static context
I don't know what to write instead because this is what my teacher said we should write.
Thank you for your help,
luna124