I'm very confused on how to add the black keys do I do the same for how I did the white keys??? They said that I need to make a new method for it but i dont know what to put. :( please help, thank you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | private String [] names = { "q" , "w" , "e" , "r" , "t" , "y" , "u" , "i" , "o" , "p" , "[" , "]" }; private String [] whiteNotes= { "3c" , "3d" , "3e" , "3f" , "3g" , "3a" , "3g" , "4c" , "4d" , "4e" , "4f" , "4g" }; /** * Make the piano. */ public Piano() { super ( 800 , 340 , 1 ); for ( int k= 0 ; k<names.length; k++){ Key key = new Key(names[k] , whiteNotes[k] ); addObject(key, 50 +k* 63 , 140 ); } } public void makeKeys() { } } |