Q:

How can I open a url in my app, not browser?

I want to open a url in my app, not in browser.How can I do this?
I think I need a webview.I use netbeans desktop app with jdk 6
If javafx needed , How can I use it?
Please give some tutorial?

A:

Why not use JEditorPane, setContentType() and setText().
You can set the content type and then get the HTML from the URL repsonse and set the JEditorPane text:
editor.setContentType( "text/html" );    
editor.setText( "<html><body>Hello, world</body></html>" );

UPDATE:
Here is a small exmaple though there are a few glitches :
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class JEditorPaneTest extends JPanel {

    public static void main(String[] args) {

        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                final JFrame frame = new JFrame();
                JEditorPane editor = new JEditorPane();

                frame.getContentPane().add(editor);

                editor.setContentType("text/html");
                URL url = null;
                try {
                    url = new URL("http://www.google.co.za");
                } catch (MalformedURLException ex) {
                    Logger.getLogger(JEditorPaneTest.class.getName()).log(Level.SEVERE, null, ex);
                }

                BufferedReader in = null;
                try {
                    in = new BufferedReader(new InputStreamReader(url.openStream()));
                } catch (IOException ex) {
                    Logger.getLogger(JEditorPaneTest.class.getName()).log(Level.SEVERE, null, ex);
                }
                String inputLine;
                StringBuffer response = new StringBuffer();
                try {
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine).append("\n");
                    }
                    in.close();
                } catch (IOException ex) {
                    Logger.getLogger(JEditorPaneTest.class.getName()).log(Level.SEVERE, null, ex);
                }

                // editor.setText("<html><body>Hello, world</body></html>");
                editor.setText(response.toString());
                editor.setEditable(false);

                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        });
    }
}

You should consider JavaFX though this has a WebView like you need: http://docs.oracle.com/javafx/2/webview/WebViewSample.java.htm
Download here: http://www.oracle.com/technetwork/java/javafx/downloads/index.html
To setup Java FX and netbeans see here: http://netbeans.org/kb/docs/java/javafx-setup.html

