display console result on java GUI for each class (java newbie programmer) -


guys..I have a simple question

to display the results of each square console on the Java GUI possible?

Each category has different console results.

  import org.jsoup. Jsoup;   

Import org.jsoup.helper.Validate; Import org.jsoup.nodes.Document; Import org.jsoup.nodes.Element; Import org.jsoup.select.Elements;

Import java.io.buffferedReader; Import java.io.buffferedWriter; Import java.io.filewiter; Import java.io.IOException; Import java.io.InputStreamReader; Import java.net.URL;

Public class SimpleWeb Crawler {Public Static Zero Main (string [] args throws IOException {

  try {url my_url = new URL ("http: // theworldaccordingtothisgirl. Blogspot.com/ "); BufferedReader br = new BufferedReader (new InputStreamReader (my_url.openstream ())); String string = ""; While (empty! = (StrTemp = br.readline ()) {System.out.println (strTemp); }} Hold (Exception pre) {ex.printStackTrace (); } System.out.println ("\ n"); Println ("\ n"); Println ("\ n"); Valid.isTrue (args.length == 0, "Usage: Supply URL to crawl"); String url = "http://theworldaccordingtothisgirl.blogspot.com/"; Print ("Moving% s ...", url); Document doctor = jsup.connect (url) .get (); Element link = doc.select ("a [href]"); Println ("\ n"); Buffed Vitaire BV = new buffed vaittar (new flamer ("abc.txt")); (Element Link: Link) {print ("% s", link.attr ("abs: href"), trim (link.text (), 35)); Bw.write (link.attr ("belly: href")); Bw.write (System.getProperty ("line.separator")); } Bw.flush (); Bw.close (); } Private Static Zero Print (String msg, Object ... Args) {System.out.println (String.format (msg, args)); } Private static string trim (string s, int width) {if (S.Langu (>> gt; width) returns s.sstring (0, width - 1) + "."; The return of others; }   

}

Example output:

Fetching ...



< Br>




if you want

I suggest you to separate the standard output ( System.out.println ), which category it comes from, the answer is no, no. To get output to each class, the constructor gets the PrintWriter as the argument, then using PrintWriter instead of System.out print author Please.

Comments