什么意思,没有懂是不是用Java写个浏览器啊?

解决方案 »

  1.   

    不懂。 估计他的意思是用java写个浏览器
      

  2.   

    在JEditorPane中加载网页:import java.awt.*;
    import javax.swing.*;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.*;
    /**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2003</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class Aaa {
      JFrame frame;
      JEditorPane editorPane;
      File file;
      String str;
      public Aaa() {
        file = new File("html/test.html");
        str = file.getAbsolutePath();
        str = "file:"+str;
        frame = new JFrame("JEditPane");
        editorPane = new JEditorPane();
        try {
          editorPane.setPage(str);
        }
        catch (IOException ex) {
          System.out.println("加载不成功!");
          System.out.println("IOException: " + ex);
        }
        frame.getContentPane().add(editorPane, BorderLayout.CENTER);    frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }});
          frame.setSize(100,260);
          frame.setVisible(true);
        }
      public static void main(String[] args) {
        Aaa aaa1 = new Aaa();
      }}另外用JEditorPane的子类JTextPane也可以加载HTML页面,方法基本相同。
      

  3.   

    new JLabel("<html><b>bbbb</b></html>")
      

  4.   

    我不太明白楼主的意思
    但有一个开源项目JR应该对你有帮助。
    他可以将java代码转变为html
    其中的一个类可以做到,不知道是不是你想要的
      

  5.   

    java的兴起就是由于java做了一个浏览器 hotjava .楼主没听说过吗? 对java的历史知道太少了:)
      

  6.   

    多谢各位帮助,我也是今年8月底接触Java,觉得不错,mq612(理想)、 kypfos(政治面貌:一世清白) 讲的方法都很值得参考,只是不知道如何给他们加分啊!