1

With below code I am getting console output.

How can I get this output in a Java Swing GUI?

import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class IntexData{

   public static void main(String[] args){
       try{
            Document doc=Jsoup.connect("https://imei24.com/phone_base/Intex/").userAgent("Mozilla/17.0").get();
            Elements temp=doc.select("div.caption");
            int i=0;
            for(Element movieList:temp)
            {
                i++;
                System.out.println(i+" "+movieList.getElementsByTag("a").first().text());
            }
       }catch(IOException e){
           e.printStackTrace();
       }
   }
}
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
D. Rudra
  • 45
  • 6
  • 1
    See [Creating a GUI With JFC/Swing](https://docs.oracle.com/javase/tutorial/uiswing/index.html). Too broad for SO. – Andrew Thompson Feb 06 '18 at 08:35
  • 1
    Side notes: 1) Please use code formatting for code and code snippets, structured documents like HTML/XML or input/output. To do that, select the text and click the `{}` button at the top of the message posting/editing form. 2) A single blank line of white space in source code is all that is *ever* needed. Blank lines after `{` or before `}` are also typically redundant. 3) Use a logical and consistent form of indenting code lines and blocks. The indentation is intended to make the flow of the code easier to follow! – Andrew Thompson Feb 06 '18 at 08:36

0 Answers0