title: Reading a formatted text file + Extracting certain information + Loading it into a JList
body: <p>So here I got my code that would read a text file:</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  public class ReadTextFile {
      public static void main(String[] args) {
          File file = new File("Test.txt");
          StringBuffer contents = new StringBuffer();
          BufferedReader reader = null;
  
          try {
              reader = new BufferedReader(new FileReader(file));
              String text = null;
  
              // repeat until all lines is read
              while ((text = reader.readLine()) != null) {
                  contents.append(text).append(System.getProperty("line.separator"));
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
              try {
                  if (reader != null) {
                      reader.close();
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
          // show file contents here
          System.out.println(contents.toString());
      }
  }
  </code></pre>
  
  <p>Ok, now I need my text file (Test.txt) to have the following structure (Example):</p>
  
  <pre><code>topic:- &lt;climate&gt;subtopic1, &lt;atmosphere_type&gt;subtopic2
  
  subtopic1:- &lt;temperatures&gt;sentence1, &lt;gases&gt;sentence2, &lt;winds&gt;sentence3
  subtopic2:- &lt;gas_composition&gt;sentence4, &lt;gravitational_weight&gt;sentence5
  
  sentence1:- temperatures are around 34ºC but they can reach -42ºC in winter
  sentence2:- there are significant proportions of nitrogen (13%) and butane (24%)
  sentence3:- there are permanent winds with gusts of 118 km/h
  sentence4:- methane (48%), nitrogen (13%), butane (24%) and oxygen (12%)
  sentence5:- gravity in ecuador is 7.95 atmospheres
  </code></pre>
  
  <p>What I really need is to have 2 <code>JList</code>, where in the first <code>JList</code> I could choose a topic (Like "climate" or "atmosphere type") and then on my second <code>JList</code> I'd select a subtopic (If I choose "climate", then I could choose "temperatures", "gases" or "winds"), so when I hit a <code>JButton</code>, the program would show me the corresponding sentence. Is it hard to do something like that? Thanks for your help! :)</p>