protected void $define() { questions = new ArrayList<String>(); questions.add("Which US President created the 'New Deal'?"); questions.add("Which US President normalized relations between the US and China?"); answers = new ArrayList<String>(); answers.add("Roosevelt"); answers.add("Carter"); imageFiles = new ArrayList<String>(); imageFiles.add("roosChurch.gif"); imageFiles.add("carterChina.gif"); this.AlignHorizontal(ALIGNMENT_CENTER); // doesn't seem to work this.Title("US Presidents Quiz"); headerLabel = new Label(this); headerLabel.FontSize(24); headerLabel.Text("Test your knowledge of US Presidents"); image = new Image(this); image.Width(this.LENGTH_FILL_PARENT); image.Picture(imageFiles.get(0)); questionLabel = new Label(this); questionLabel.Text(questions.get(0)); nextButton = new Button(this); nextButton.Text("Next"); hArrangement1 = new HorizontalArrangement(this); hArrangement1.Width(LENGTH_FILL_PARENT); answerTextBox = new TextBox(hArrangement1); answerTextBox.Width(LENGTH_FILL_PARENT); answerTextBox.BackgroundColor(this.COLOR_LTGRAY); answerTextBox.Hint("enter answer (last names, all caps)"); submitButton = new Button(hArrangement1); submitButton.Text("Submit"); resultLabel = new Label(this); resultLabel.Text(""); EventDispatcher.registerEventForDelegation(this, "Next", "Click"); }