// Each button has 3 states : blank|nought|cross
int i = 0;
for(int r = 0; r < 3; r++) {
for(int c = 0; c < 3; c++) {
MsbConfig tile_btn_config = new MsbConfig();
MsbState tile_btn_state_blank = new MsbState(Constants.TILE_STATE_BLANK, "Blank Tile", "Blank Tile");
tile_btn_state_blank.setbmp_focused(blank_focused);
tile_btn_state_blank.setbmp_unfocused(blank_unfocused);
tile_btn_state_blank.setbmp_clicked(blank_clicked);
tile_btn_state_blank.setbmp_unclicked(blank_focused);
tile_btn_config.addState(tile_btn_state_blank);
MsbState tile_btn_state_nought = new MsbState(Constants.TILE_STATE_NOUGHT, "Nought", "Nought");
tile_btn_state_nought.setbmp_focused(nought_focused);
tile_btn_state_nought.setbmp_unfocused(nought_unfocused);
tile_btn_state_nought.setbmp_clicked(nought_clicked);
tile_btn_state_nought.setbmp_unclicked(nought_focused);
tile_btn_config.addState(tile_btn_state_nought);
MsbState tile_btn_state_cross = new MsbState(Constants.TILE_STATE_CROSS, "Cross", "Cross");
tile_btn_state_cross.setbmp_focused(cross_focused);
tile_btn_state_cross.setbmp_unfocused(cross_unfocused);
tile_btn_state_cross.setbmp_clicked(cross_clicked);
tile_btn_state_cross.setbmp_unclicked(cross_focused);
tile_btn_config.addState(tile_btn_state_cross);
MultiStateButtonField msbf_tile = new MultiStateButtonField(tile_btn_config, cmd_select_tile, 0, Field.FIELD_HCENTER);
msbf_tile.setFocusListener(focus_listener);
tiles[i] = msbf_tile;