Create a Mad Lib program in Java using a GUI interface.. Your program must ask the user for at least 4 different words and then fill them into a story. What size must you make the textFields and fame to get it to look like the example shown? Make up your own MadLib similar to one of the examples below: |
Example 1: |
My favorite book is "__________ (name of a person) Potter and the Chamber of __________ (noun, plural)." |
Example 2: |
Today I went to the zoo. I saw a _____________ (noun) jumping up and down in its tree. |
Example 3: |
Our cafeteria is wierd. Today I saw _______ (name of person) drinking _____ (a liquid) with lunch. |
Reminders:
To get the word entered into a textField named nounBox:
String noun = nounBox.getText( );
To join words into a sentence:
answerLabel.setText("Today I went to the zoo. I saw a " + noun + " jumping up and down in its tree. The "+noun+" "+verb+" through the large tunnel that led to its "+adjective+ " " + noun2);
Don't forget the spaces in between words!