我还不清楚你的意思。
另外printTable()的参数的类型是数据集吗?
你的意思是不是因为HTML文件里的表格都是类似<table><tr><td>.....</table>样的,
而这个printTable()的参数要求又跟上面的标记语言不匹配,是吗?
我不知道java里面有没有专门处理标记语言的组件,要是没有的话,那你就自己编个类专门来处理吧!

解决方案 »

  1.   

    to  cocolovevienna():
    我的意思是将html在ie浏览器中的内容预览并打印出来,不知道有没有现成好的办法,另外printTable()的参数类型定义了一个table templete:
    public abstract class tableTemplet {
      public  String values;
      public Vector cells;
      public int tableWidth=0;
      private static final String split="/,/";
      public tableTemplet(){
       }  public static class FaWenTemplet extends tableTemplet{
        public  FaWenTemplet(String s){
          values=s;
          pCell cell=null;
          String cellText[]=values.split(split);
          cells=new Vector(35);
          tableWidth=440;      cells.add(0,new pCell(240,44,0,0,"发文稿纸"));
          cell=(pCell)(cells.elementAt(0));
          cell.font=new Font("宋体",Font.TRUETYPE_FONT+Font.BOLD,22);
          cell.fColor=Color.red;
          cell.xAlign=1;      cells.add(1,new pCell(200,22,0,240,"密级  ("+cellText[0]+")"));      cells.add(2,new pCell(200,22,22,240,"缓急  ("+cellText[1]+")"));      cells.add(3,new pCell(180,132,44,0,"签  发:"+cellText[2]));
          cell=(pCell)(cells.elementAt(3));
          cell.yAlign=0;      cells.add(4,new pCell(260,44,44,180,"会  签:"+cellText[3]));
          cell=(pCell)(cells.elementAt(4));
    ............
      

  2.   

    我现在也在做这个,HTML可以加到jTextPane中显出来;
    我现在是在JTABLE中取出数据动态生成HTML的TABLE;
    然后在jTextPane中加载HTML;