How to open a webpage in frame?

How do I open a webpage in frame?

(I use netbeans and java)

for example on an html page that you can use

  <frame src="http://www.google.com">

and it will display Google in the frame.

I do not want it to open the browser, just to open it inside the frame. How can i do this?

+3
source share
4 answers

Here is a quick example of loading Google using JEditorPane. I hope this is what you are looking for, but I'm still not 100% sure what exactly you want. If you could provide a little more information about what you are doing, I would be able to help you more.

import javax.swing.*;

public class GetWebPage {
    public static void main(String args[]) throws Exception {
        JEditorPane website = new JEditorPane("http://www.google.com/");
        website.setEditable(false);

        JFrame frame = new JFrame("Google");
        frame.add(new JScrollPane(website));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        frame.pack();
    }

}
+6
source

Hope this helps

- FRAME html, .

" Mozilla Widget for Java Swing" MozSwing, , , , :)

+3

, webbrowser (.net) J2SE. , J2SE .

JEditorPane, .

: :

ICEbrowser

0

JEditorPane . HTML 3.2. JWebEngine HTML 4. JWebEngine - Java . ICEbrowser - EOL.

0

Source: https://habr.com/ru/post/1727025/


All Articles