Webbrowser?

Discussion in 'Programming General' started by Michael3455, Nov 8, 2007.

Webbrowser?
  1. Unread #1 - Nov 8, 2007 at 4:48 AM
  2. Michael3455
    Joined:
    Sep 11, 2005
    Posts:
    134
    Referrals:
    0
    Sythe Gold:
    0

    Michael3455 Active Member

    Webbrowser?

    Hey, I was wondering if Java (using the swing GUI library) has a built in webbrowser control like that of vb.net? Or anyway at all to easily place a webbrowser inside of an application? I'm using Netbeans 5.0 and Matisse to make the GUI, if that helps of hinders.
     
  3. Unread #2 - Nov 12, 2007 at 11:27 AM
  4. katcho
    Joined:
    May 27, 2005
    Posts:
    174
    Referrals:
    0
    Sythe Gold:
    0

    katcho Active Member
    Banned

    Webbrowser?

    Look up JDIC. If you know a little bit of java, this should help a lot.
     
  5. Unread #3 - Nov 13, 2007 at 2:55 AM
  6. Michael3455
    Joined:
    Sep 11, 2005
    Posts:
    134
    Referrals:
    0
    Sythe Gold:
    0

    Michael3455 Active Member

    Webbrowser?

    Yeah, someone suggested JDIC to me on another forum, but thanks for posting (Completely forgot I posted it here). It works very nicely and is extremely simple to do.
     
  7. Unread #4 - Nov 18, 2007 at 2:11 PM
  8. crashcourse
    Joined:
    Nov 18, 2007
    Posts:
    236
    Referrals:
    0
    Sythe Gold:
    0

    crashcourse Active Member

    Webbrowser?

    There should be some sample code for implementing a web browser with Java, its definately possible. Check out the Sun.com Java tutorials, there should be a section in there with ALOT of sample code included.
     
  9. Unread #5 - Nov 18, 2007 at 5:37 PM
  10. Michael3455
    Joined:
    Sep 11, 2005
    Posts:
    134
    Referrals:
    0
    Sythe Gold:
    0

    Michael3455 Active Member

    Webbrowser?

    Ok, I'll post this incase anyone else wants to see it.

    It's a very MINIMAL webbrowser that BARELY works, but it demonstrates how to make one using JDIC.

    Ok, first add a JTextField, JButton and a JTabbedPane. Make it look however you want, and then on the JButton ActionPreformed event, place this code.

    Code:
     try {
        WebBrowser wb=new WebBrowser();
        
        wb.setURL(new URL(txtURL.getText()));
        browPane.add(wb);
        } catch(Exception ex) {
            
          JOptionPane.showMessageDialog(null,ex.getMessage());
    }
        }         
    
    It's quick, dirty, and copied straight off of some website. Hey, I had no idea what to do so I needed a tutorial too. So, yes. I'm not taking any credit for this.


    But, still, won't work on my comp just yet. I'm too lazy to figure out how to set the default browser :p
     
  11. Unread #6 - Nov 23, 2007 at 3:03 AM
  12. x⁹
    Referrals:
    1

    x⁹ Guest

    Webbrowser?

    You can also use a JEditorPane to display HTML content. It's not very useful, though. JDIC is your best bet.
     
  13. Unread #7 - Nov 23, 2007 at 5:46 PM
  14. timk777
    Joined:
    Feb 19, 2007
    Posts:
    156
    Referrals:
    0
    Sythe Gold:
    0

    timk777 Active Member

    Webbrowser?

< New timer | [Source] Skull Timer >

Users viewing this thread
1 guest


 
 
Adblock breaks this site