title: How to display the console output in a text area with sepertid calsses in javax.swing.JFrame
body: <p>I'm trying to display the console output in a text area. 
  I have a (view) bottom that creates object from class <code>Functional</code>. Inside this class there is method that view all the context of table in table in data base and return the result of the query and printed it into the console window. So I need to display this output from the console window to a text area in the GUI class .     </p>
  
  <p>This is the GUI class:</p>
  
  <pre><code>public class MainGUI extends javax.swing.JFrame {
      private void SearchButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
          Functional search = new Functional();
          search.search(SearchTextField.getText(), ItemsComboBox.getSelectedItem().toString());
  
      }               
  }
  </code></pre>
  
  <p>This is the <code>Functional</code> class:</p>
  
  <pre><code>public class Functional {
  
      public void viewDtailes(String item) {
  
          try (Connection con = DriverManager.getConnection("jdbc:odbc:Library_DNS"); 
               Statement stmt = con.createStatement()) {
              if(item.equals("magazins")){
                  String sql = "SELECT * FROM " + item;
                  ResultSet rs = stmt.executeQuery(sql);
                  while(rs.next()){
                      System.out.println(" callNo : " + rs.getString("callno") + " title: " + rs.getString("title")+" Vnom :" + rs.getString("Vnom") + " status: " + rs.getBoolean("status"));
                  }
              } else {
                  String sql = "SELECT * FROM "+ item;
                  ResultSet rs = stmt.executeQuery(sql);
                  while(rs.next()){
                      System.out.println("callNo : " + rs.getString("callno")+ " title: " + rs.getString("title")+ " author :" + rs.getString("author") + " status: " + rs.getBoolean("status"));
                  }
              }
          } catch (SQLException sqle) {
              System.out.println("Sql Exception :" +sqle.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>The output from console:</p>
  
  <p><img src="https://i.stack.imgur.com/iOGt4.png" alt="output from console"> </p>
  
  <p>I need to display the console output in this text area GUI:</p>
  
  <p><img src="https://i.stack.imgur.com/ETGw8.png" alt="Display output from GUI"></p>