I am creating a phrasal template word game also known as mad libs. So far I was able to create a console to display the story that was put together based on the input. I was also able to create a background colour however I got stuck when I wanted to add some graphics such as rectangles and squares. How would you suggest I could incorporate that into my program?
Thank you in advance!!
import java.util.Scanner;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.ButtonGroup;
public class MadLibs {
public static void Action1 ()
{
Scanner input = new Scanner(System.in);
System.out.println("Male Friend:");
String maleFriend = input.nextLine();
System.out.println("Adjective:");
String adjective1 = input.nextLine();
System.out.println("Past Tense Verb:");
String pastTenseVerb1 = input.nextLine();
System.out.println("Past Tense Verb 2:");
String pastTenseVerb2 = input.nextLine();
System.out.println("Large Number:");
String largeNumber = input.nextLine();
JLabel label = new JLabel("<html>Last summer, my friend "+ maleFriend + " got a job at the " + adjective1 +" Pastry Shop. For the first few<br>"
+ "weeks, he" + pastTenseVerb1 + " the floors, " + pastTenseVerb2 + " on the shelves, and unloaded " + largeNumber + " pound sacks <br>"
+"of flour from the delivery trucks."
+ "</html>"
, JLabel.CENTER);
JFrame window = new JFrame("Please print this");
window.setSize(600, 800);
window.add(label);
window.getContentPane().setBackground(Color.CYAN);
window.setVisible(true);
}
public static void main(String []args){
Action1();
}
}