我有个办法,不过比较笨。
可别笑。
你从网上下载(用datainputstream),保存为txt,然后改为htm,
你可以用
try
   {File file=new File (filedialog_load.getDirectory (),filedialog_load.getFile ());
Runtime ce=Runtime.getRuntime ();
ce.exec (file.toString ());
   }
   catch(FileNotFoundException e1){}
   catch(IOException e2){}
试试看!

解决方案 »

  1.   

    我作了一个小的浏览器 只要你输入网址就可打开网上的网页
     我的e 妹是 [email protected] 如果要源代码的话我可要高分不然我不会
      发过来的
      

  2.   

    zengjuncsdn(zj)我要一份,给你100可以吗?
    [email protected]
      

  3.   

    你好 你的[email protected]有问题 无法发送代码给你 有没有其它的邮件地址
      

  4.   

    你好 你有[email protected]有问题我无法发送代码给你
      

  5.   

    sun公司的jsdk中的swing包中自己带一个浏览器文本框的类。不过不支持flash之类的东东,只能看html。
      

  6.   

    JEditorPane, JTextPane都可以直接显示html页,也可以处理超链接事件,编一个基本的浏览器够用了。
    Sun的HotJava浏览器是完全基于java实现的,可以找一个来参考。
      

  7.   

    呵呵,给你个例子,用来显示D盘上的名叫1.htm的网页文件:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;public class Test extends JFrame {
    private JEditorPane editorPane = new JEditorPane(); public Test() {
    Container contentPane = getContentPane(); String url = "file:d:\\1.htm"; editorPane.setEditable(false); try { 
    editorPane.setPage(url);
    }
    catch(Exception ex) { ex.printStackTrace(); } contentPane.add(new ControlPanel(), BorderLayout.NORTH);
    contentPane.add(new JScrollPane(editorPane), 
    BorderLayout.CENTER);
    }
    class ControlPanel extends JPanel {
    private JCheckBox edit = new JCheckBox("Editable"); public ControlPanel() {
    add(edit);
    edit.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    editorPane.setEditable(edit.isSelected());
    }
    });
    }
    }
    public static void main(String args[]) {
    GJApp.launch(new Test(), 
    "JEditorPane",300,300,650,450);
    }
    }
    class GJApp extends WindowAdapter {
    static private JPanel statusArea = new JPanel();
    static private JLabel status = new JLabel(" ");
    static private ResourceBundle resources; public static void launch(final JFrame f, String title,
      final int x, final int y, 
      final int w, int h) {
    launch(f,title,x,y,w,h,null);
    }
    public static void launch(final JFrame f, String title,
      final int x, final int y, 
      final int w, int h,
      String propertiesFilename) {
    f.setTitle(title);
    f.setBounds(x,y,w,h);
    f.setVisible(true); statusArea.setBorder(BorderFactory.createEtchedBorder());
    statusArea.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
    statusArea.add(status);
    status.setHorizontalAlignment(JLabel.LEFT); f.setDefaultCloseOperation(
    WindowConstants.DISPOSE_ON_CLOSE); if(propertiesFilename != null) {
    resources = ResourceBundle.getBundle(
    propertiesFilename, Locale.getDefault());
    } f.addWindowListener(new WindowAdapter() {
    public void windowClosed(WindowEvent e) {
    System.exit(0);
    }
    });
    }
    static public JPanel getStatusArea() {
    return statusArea;
    }
    static public void showStatus(String s) {
    status.setText(s);
    }
    static Object getResource(String key) {
    if(resources != null) {
    return resources.getString(key);
    }
    return null;
    }
    }