package lyrics;

import java.awt.Component;
import java.util.*;
import javax.swing.JOptionPane;

public class checkinLyrics {
    private static Component frame;

    public static void main(String[] args) {
        JOptionPane.showMessageDialog(frame, "Welcome to the lyrics checker!");
        String lyrics = asker();
        String[] words = taboo();
        
        System.out.println("Your lyrics are: " + lyrics);
        System.out.println("The word you're looking for is: " + turnToString(words));
    }
    // TODO in other method, make the inputs toUpperCase();
    public static String asker() {
        String allLyrics = JOptionPane.showInputDialog(frame, "Please input the song lyrics:");
        return allLyrics;
    }
    public static String[] taboo() {
        String theWord = JOptionPane.showInputDialog(frame, "What word are you looking for?");
        
        int i = 0;
        String[] wordArr = new String[1];
        wordArr[0] = theWord;
        String[] listWords = new String[i];
        // TODO change this to a do/while loop
        while (theWord.equals("END") == false) {
            listWords = Arrays.copyOf(wordArr, i+2);
            listWords[i] = theWord;
            i++;
            theWord = JOptionPane.showInputDialog(frame, "Is there another word? Type \"END\" to stop.");
        }
        System.out.println(listWords[0] + listWords[1]);
        return listWords;
    }
    
    public static String turnToString(String[] arr) {
        String hi = "";
        for (int i = 0; i<arr.length; i++) {
            hi = hi + " " + arr[i];
        }
        System.out.println(hi);
        return hi;
    }
}

@@ -357,32 +357,24 @@
 = taboo();%0D%0A
-        
 %0D%0A        Sy
@@ -512,24 +512,26 @@
 ));%0D%0A    %7D%0D%0A
+%0D%0A
     // TODO 
@@ -742,24 +742,26 @@
 cs;%0D%0A    %7D%0D%0A
+%0D%0A
     public s
@@ -886,24 +886,64 @@
 );%0D%0A        
+// TODO fix this method so it's smoother
 %0D%0A        in
@@ -948,17 +948,17 @@
 int i = 
-0
+1
 ;%0D%0A     
@@ -1059,120 +1059,168 @@
 s = 
-new String%5Bi%5D;%0D%0A        // TODO change this to a do/while loop%0D%0A        while (theWord.equals(%22END%22) == false) %7B
+Arrays.copyOf(wordArr, wordArr.length);%0D%0A        do %7B%0D%0A            theWord = JOptionPane.showInputDialog(frame, %22Is there another word? Type %5C%22END%5C%22 to stop.%22);
 %0D%0A  
@@ -1259,20 +1259,39 @@
 yOf(
-wordArr, i+2
+listWords, listWords.length + 1
 );%0D%0A
@@ -1345,24 +1345,26 @@
   i++;%0D%0A
+%0D%0A
         
     theW
@@ -1359,116 +1359,245 @@
     
-    theWord = JOptionPane.showInputDialog(frame, %22Is there another word? Type %5C%22END%5C%22 to stop.%22);%0D%0A        %7D
+%7D while (theWord.equals(%22END%22) == false);%0D%0A        String%5B%5D finalArray = Arrays.copyOf(listWords, listWords.length - 1); // takes off the END entry. not very elegant.%0D%0A        /*%0D%0A         * println's checking if you got the right arrays
 %0D%0A  
@@ -1593,32 +1593,35 @@
  arrays%0D%0A       
+  *
  System.out.prin
@@ -1628,23 +1628,85 @@
 tln(
-listWords%5B0%5D + 
+Arrays.toString(finalArray));%0D%0A         * System.out.println(Arrays.toString(
 list
@@ -1710,19 +1710,17 @@
 istWords
-%5B1%5D
+)
 );%0D%0A    
@@ -1727,24 +1727,38 @@
     
-return listWords
+ */%0D%0A        return finalArray
 ;%0D%0A 
@@ -1763,20 +1763,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    pu
@@ -1874,9 +1874,11 @@
 0; i
-%3C
+ %3C 
 arr.

Update checkinLyrics.java