title: How to show message by messages from main class in UI window?
body: <p>Unfortunately I can't do step by step output in the main program window (object g). </p>
  
  <h2>Part of main class:</h2>
  
  <pre><code>/* Create a main window  of GUI*/  
      Gui g = new Gui();        
      g.showitself(); /*object is shown on the screen*/
  
      /*Check folder existing*/
      boolean inOutFilesFolderExists = (new File(vars.diskLetter+"//"+vars.ppmRootFolder+"//"+vars.inOutFilesFolder).exists());
           if (inOutFilesFolderExists)
              {
               System.out.println("Folder exists."); /*it is just for understanding if-operator works*/
               String textMessage = "\n"+"Folder " + vars.diskLetter+"//"+vars.ppmRootFolder+"//"+vars.inOutFilesFolder + "exists."+"\n" ; /*the message that I want to show in the main screen*/
               g.printmessage(logCurDateTime, textMessage); /*I am trying to show textMessage in the main GUI window by this method - g.printmessage  */
               }
           else
               { System.out.println("Folder doesn’t exists.");
              String textMessage = "Folder " + vars.diskLetter+"//"+vars.ppmRootFolder+"//"+vars.inOutFilesFolder + " doesn’t exist and will be created." ;
               g.printmessage(logCurDateTime, textMessage);
               new File(vars.diskLetter+"//"+vars.ppmRootFolder+"//"+vars.inOutFilesFolder).mkdirs();
               }
  /** Now I am trying to create a new text message that should follow after previous text message */
              String textMessage = "Hello, Java Log.";
             // get to g object variables for showing 
              g.printmessage(logCurDateTime,  textMessage);
  </code></pre>
  
  <h2>GUI class:</h2>
  
  <pre><code>        public class Gui {
                          Border solidBorder = BorderFactory.createLineBorder(Color.GRAY, 6);
                          Font font = new Font("Verdana", Font.PLAIN, 12);
                         //method which shows the main window of GUI
                          JFrame main_Window = new JFrame("PPM v.2.0");
                          public void showitself ()
                         {
                              main_Window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                              main_Window.setSize(800, 400);
                              main_Window.setVisible(true);
                         }
                          /*This method should show messages from main class */
                          void printmessage (String logCurDateTime, String textMessage)
                         {
                         JLabel label = new JLabel("      " + logCurDateTime + " - " + textMessage +"\n");
                          main_Window.getContentPane().add(label);
                          }
          }
  </code></pre>
  
  <p>As result I receive GUI main screen only with the last message "Hello, Java Log.". 
  As I understand it means than the previous message is rewritten by the next, but I need  a serial output of messages (message by message) like this:</p>
  
  <blockquote>
    <p>logCurDateTime  - Folder exists. (or Folder doesn’t exist and will be created.)</p>
    
    <p>logCurDateTime - "Hello, Java Log."</p>
  </blockquote>
  
  <p>Also I am trying to recode (using <code>eclipse.swt</code> library) printmessage method as </p>
  
  <pre><code>void printmessage (String logCurDateTime, String textMessage)
               {
  
               JTextArea mainTextArea = new JTextArea();
               mainTextArea.append(logCurDateTime + textMessage +"/n");
               }
  </code></pre>
  
  <p>But it doesn’t help (no any message at all). </p>
  
  <p>How to make a code which show messages from main class one by one?</p>