This is what I have so far.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class background here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class background extends World
{
private String bassButtons = {"a","S","d","f","g","h","j","k","l",";","'","\\"};
private String bassSounds = {"3c","3d","3e","3f","3g","3a","3b","4c","4d","4e","4f","4g"};
//private Button textButton=null;
/**
* Constructor for objects of class background.
*
*/
public background()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
bassButtons();
// creating the button
//Button textButton= new Button("Click here to run method");
//addObject(textButton, 500, 30);
// in the act to catch button click
//if(textButton.getWorld() != null && textButton.gotClicked()) methodName();
}
private void bassButtons()
{
int i = 0;
while (i < bassButtons.length) {
button key = new button (bassButtons, bassSounds+".wav");
addObject(key,i*key.getImage().getWidth() + 54,140);
i++;
}
}
}