Here you can find the source of setInfo(String info, JFrame root)
public static void setInfo(String info, JFrame root)
//package com.java2s; //License from project: Apache License import java.awt.Component; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextArea; public class Main { private static int sumError = 0; private static int sumExistError = 0; private static int sumNotFoundError = 0; private static int sumSuccess = 0; private static int sumNum = 1; public static void setInfo(String info, JFrame root) { sumError += 1;/*w ww .j a va 2 s .co m*/ info.equals(""); Component[] components = root.getRootPane().getContentPane().getComponents(); for (int i = 0; i < components.length; i++) { if (components[i].getClass().toString().equals("class javax.swing.JScrollPane")) { JTextArea textarea = (JTextArea) ((JScrollPane) components[i]).getViewport().getView(); if (info.equals("")) { sumError = 0; sumExistError = 0; sumNotFoundError = 0; sumSuccess = 0; sumNum = 1; textarea.setText(""); } else if ((textarea.getText().equals("")) || (textarea.getText() == null)) { textarea.setText(sumNum + ". " + info); } else { textarea.setText(textarea.getText() + "\n" + sumNum + ". " + info); } } } } }