Results 1 to 8 of 8

Thread: Browser in JAVA

  1. #1
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default Browser in JAVA

    I am working on networking now. I am trying to Display a webpage and source code for that page on JFrame.CODE is being displayed but when I press on the view button, webpage open in browser as normal.BUt I want to display it on the Jframe.Can anyone help me.

    Here is the partial code :
    Java Code:
                    
     buttonForView.addActionListener(new ActionListener(){
    			public void actionPerformed(ActionEvent ae){
                         
    //tf.gettext() retrieves the url address 
    	String web[] ={"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE",tf.getText()};
    	try{
        p = r.exec(web);                      
    //here the help is needed. I have a testArea.I need to display it on that.
    				
                           }
    			catch(Exception e){
    JOptionPane.showMessageDialog(pen,"Invalid URL","Warning",JOptionPane.WARNING_MESSAGE);	}
    				}
    			});
    If you are not clear about my problem,please tell me

    Thanking you
    Ujjal
    Last edited by UJJAL DHAR; 08-21-2011 at 03:45 PM.
    Don't Forget to try yourself before asking others help.....
    Press REP, if you find their advices/solutions effective.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    I want to display it on the Jframe.
    You can format and display simple HTML by using the JEditorPane class.
    Since most web pages have complicated HTML and javascript, you won't be able to format and display them in a JEditorPane.

  3. #3
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    Norm,
    then what is the solution?
    Can you help me a little.

    thanks in advance
    Don't Forget to try yourself before asking others help.....
    Press REP, if you find their advices/solutions effective.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    I don't know of a way to read, format and display a complicated html page in a java component.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default

    Search the net for JDIC or change to JavaFX 2.0 (still in beta) which has a WebView component.

    db

  6. #6
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default Re: Browser in JAVA

    Use the SWT Browser object. If you are going to mix it with Swing components then you will have to bridge Swing and SWT.

  7. #7
    pink123 is offline Member
    Join Date
    Feb 2011
    Posts
    84
    Rep Power
    0

    Default Re: Browser in JAVA

    Hi,

    How did you solved it,I have to do a similar kind of thing.Any suggestions?

    Thanks,

  8. #8
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default Re: Browser in JAVA

    pink123,
    I didn't.Actually I didn't try.
    You should try this.
    Quote Originally Posted by fxRichard View Post
    Use the SWT Browser object. If you are going to mix it with Swing components then you will have to bridge Swing and SWT.
    Don't Forget to try yourself before asking others help.....
    Press REP, if you find their advices/solutions effective.

Similar Threads

  1. java Web Browser
    By MarkWilson in forum Advanced Java
    Replies: 2
    Last Post: 10-20-2012, 08:10 PM
  2. web browser in java
    By diptopol in forum New To Java
    Replies: 1
    Last Post: 08-21-2011, 03:58 PM
  3. Need help with idea of java css web browser
    By skorpikon in forum New To Java
    Replies: 2
    Last Post: 05-03-2011, 08:11 AM
  4. Java browser [help]
    By runedog48 in forum Advanced Java
    Replies: 7
    Last Post: 03-23-2011, 08:32 AM
  5. java networking via browser
    By pratik.ac in forum Networking
    Replies: 2
    Last Post: 04-21-2008, 05:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •