出现这种报错信息:Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
AbstractTablemodel cannot be resolved
abstracttablemodel cannot be resolved to a type
The method SetReorderingallowed(boolean) is undefined for the type TableColumnModel at reportdatacreat.<init>(reportdatacreat.java:37)
at reportdatacreat.main(reportdatacreat.java:97)
附上代码:import   java.awt.*;   
 import   java.awt.event.*;   
 import   javax.swing.*;   
 import   javax.swing.event.*;   
  //import   java.io.file;   
  import   javax.swing.table.*;   
  import   java.util.*;   
  import   javax.swing.border.*;   
    
  public   class   reportdatacreat   extends  JFrame   {   
    
      private   JLabel   label1=new  JLabel ("报表格式文件");   
      private   JLabel   label2=new  JLabel ("文件保存到");   
      private   JButton   button1=new   JButton ("浏览");   
      private   JButton    button2=new   JButton ("浏览");   
      private   JButton   button3=new   JButton ("报表数据生成并显示");   
      private   JButton   button4=new  JButton ("报表数据生成并保存");   
      private  JTextField   text1=new   JTextField (10);   
      private   JTextField  text2=new   JTextField (10);   
      private  Vector   vect;//声明一个向量对象   
      private  JTable   table=new  JTable();   
      private   String   title[]={"条件提示","条件值"};   
      //abstracttablemodel   tm  ;//定义一个数据表模型变量   
      private  JPanel   jpanel1=new   JPanel ();   
      private  JPanel    jpanel2=new   JPanel ();   
      private  JPanel   jpanel3=new   JPanel ();   
      private  JPanel    jpanel3_1=new   JPanel ();   
      private  JPanel   jpanel3_2=new  JPanel ();   
    
    
      public   reportdatacreat(){   
    
          /******************************************   
          表模型的定义   
          ******************************************/   
          vect=new   Vector();//实例化向量   
        AbstractTablemodel  =new   abstracttablemodel(){      
                  public   int   getcolumncount(){   
                  return   title.length;}//取得表格列数   
                  public   int   getrowcount(){   
                  return   vect.size();}//取得表格行数   
                  public   object   getvalueat(int   row,int   column){   
                  if(!vect.isempty())   
                  return   
                ((vector)vect.elementat(row)).elementat(column);   
                  else   
                  return   null;}//取得单元格中的属性值   
                  public   string   getcolumnname(int   column){   
                  return   title[column];}//设置表格列名   
                  public   void   setvalueat(object   value,int   row,int   column){}   
                  //数据模型不可编辑,该方法设置为空   
                  public   Class   getcolumnclass(int   c){   
                  return   getvalueat(0,c).getclass();   
                  }//取得列所属对象类   SetAutoresizemode
            };   
            JTable tm = new JTable();//生成自己的数据模型   
            table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF);//生成水平滚动条   
    
            jpanel1.setLayout(new   FlowLayout());   
            jpanel1.add(label1);   
            jpanel1.add(text1);   
            jpanel1.add(button1);   
    
            TitledBorder   titledborder1   =   new   TitledBorder(BorderFactory.createEtchedBorder(Color.white,new  Color(148,   145,   140)),"数据生成条件录入");   
            jpanel2.setLayout(new  FlowLayout());   
            jpanel2.setBorder(titledborder1);   
           JScrollPane   sp=new   JScrollPane();   
            sp.getViewport().add(table,null);   
            jpanel2.add(sp);   
            table.getColumnModel().getColumn(0).setPreferredWidth(200);   
            table.getColumnModel().getColumn(1).setPreferredWidth(200);   
            table.getColumnModel().SetReorderingallowed(false);   
   
    
            jpanel3_1.setLayout(new   FlowLayout());   
            jpanel3_1.add(label2);   
            jpanel3_1.add(text2);   
            jpanel3_1.add(button2);   
            jpanel3_2.setLayout(new  FlowLayout());   
            jpanel3_2.add(button3);   
            jpanel3_2.add(button4);   
            jpanel3.setLayout(new  GridLayout(2,1));   
            jpanel3.add(jpanel3_1);   
            jpanel3.add(jpanel3_2);   
    
        this.getContentPane().setLayout(new   BorderLayout());   
        this.getContentPane().add(jpanel1,"north");   
        this.getContentPane().add(jpanel2,"center");   
        this.getContentPane().add(jpanel3,"south");   
        //this.setresizable(false);   
        this.setSize(500,300);   
        this.setLocation(120,10);   
        this.show();   
    
      }   
    public   static   void   main(String   args[]){   
          reportdatacreat   msb =new   reportdatacreat();   
    
    }   
    
  } 

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【ppllxx123123ppllxx】截止到2008-08-01 17:10:11的历史汇总数据(不包括此帖):
    发帖的总数量:16                       发帖的总分数:323                      每贴平均分数:20                       
    回帖的总数量:20                       得分贴总数量:2                        回帖的得分率:10%                      
    结贴的总数量:12                       结贴的总分数:253                      
    无满意结贴数:2                        无满意结贴分:30                       
    未结的帖子数:4                        未结的总分数:70                       
    结贴的百分比:75.00 %               结分的百分比:78.33 %                  
    无满意结贴率:16.67 %               无满意结分率:11.86 %                  
    楼主加油

    取消马甲机器人,请点这里:http://www.java2000.net/mycsdn/robotStop.jsp?usern=ppllxx123123ppllxx
      

  2.   

     AbstractTablemodel这是在哪定义的?
      

  3.   

    有的包没有导入
    AbstractTablemodel  =new  abstracttablemodel没有变量的名字,后面的类名也不对
    后面代码中好多类的名字都是错的,比如大写写成小写。还有些不正确的强制类型装换。
      

  4.   

    import   java.awt.*;   
     import   java.awt.event.*;   
     import   javax.swing.*;   
     import   javax.swing.event.*;   
      //import   java.io.file;   
      import   javax.swing.table.*;   
      import   java.util.*;   
      import   javax.swing.border.*;   
        
      public   class   reportdatacreat   extends  JFrame   {   
        
          private   JLabel   label1=new  JLabel ("报表格式文件");   
          private   JLabel   label2=new  JLabel ("文件保存到");   
          private   JButton   button1=new   JButton ("浏览");   
          private   JButton    button2=new   JButton ("浏览");   
          private   JButton   button3=new   JButton ("报表数据生成并显示");   
          private   JButton   button4=new  JButton ("报表数据生成并保存");   
          private  JTextField   text1=new   JTextField (10);   
          private   JTextField  text2=new   JTextField (10);   
          private  Vector   vect;//声明一个向量对象   
          private  JTable   table=new  JTable();   
          private   String   title[]={"条件提示","条件值"};   
          //abstracttablemodel   tm  ;//定义一个数据表模型变量   
          private  JPanel   jpanel1=new   JPanel ();   
          private  JPanel    jpanel2=new   JPanel ();   
          private  JPanel   jpanel3=new   JPanel ();   
          private  JPanel    jpanel3_1=new   JPanel ();   
          private  JPanel   jpanel3_2=new  JPanel ();   
        
        
          public   reportdatacreat(){   
        
              /******************************************   
              表模型的定义   
              ******************************************/   
              vect=new   Vector();//实例化向量   
            AbstractTablemodel  =new   abstracttablemodel(){      
                      public   int   getcolumncount(){   
                      return   title.length;}//取得表格列数   
                      public   int   getrowcount(){   
                      return   vect.size();}//取得表格行数   
                      public   object   getvalueat(int   row,int   column){   
                      if(!vect.isempty())   
                      return   
                    ((vector)vect.elementat(row)).elementat(column);   
                      else   
                      return   null;}//取得单元格中的属性值   
                      public   string   getcolumnname(int   column){   
                      return   title[column];}//设置表格列名   
                      public   void   setvalueat(object   value,int   row,int   column){}   
                      //数据模型不可编辑,该方法设置为空   
                      public   Class   getcolumnclass(int   c){   
                      return   getvalueat(0,c).getclass();   
                      }//取得列所属对象类   SetAutoresizemode
                };   
                JTable tm = new JTable();//生成自己的数据模型   
                table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF);//生成水平滚动条   
        
                jpanel1.setLayout(new   FlowLayout());   
                jpanel1.add(label1);   
                jpanel1.add(text1);   
                jpanel1.add(button1);   
        
                TitledBorder   titledborder1   =   new   TitledBorder(BorderFactory.createEtchedBorder(Color.white,new  Color(148,   145,   140)),"数据生成条件录入");   
                jpanel2.setLayout(new  FlowLayout());   
                jpanel2.setBorder(titledborder1);   
               JScrollPane   sp=new   JScrollPane();   
                sp.getViewport().add(table,null);   
                jpanel2.add(sp);   
                table.getColumnModel().getColumn(0).setPreferredWidth(200);   
                table.getColumnModel().getColumn(1).setPreferredWidth(200);   
                table.getColumnModel().SetReorderingallowed(false);   
       
        
                jpanel3_1.setLayout(new   FlowLayout());   
                jpanel3_1.add(label2);   
                jpanel3_1.add(text2);   
                jpanel3_1.add(button2);   
                jpanel3_2.setLayout(new  FlowLayout());   
                jpanel3_2.add(button3);   
                jpanel3_2.add(button4);   
                jpanel3.setLayout(new  GridLayout(2,1));   
                jpanel3.add(jpanel3_1);   
                jpanel3.add(jpanel3_2);   
        
            this.getContentPane().setLayout(new   BorderLayout());   
            this.getContentPane().add(jpanel1,"north");   
            this.getContentPane().add(jpanel2,"center");   
            this.getContentPane().add(jpanel3,"south");   
            //this.setresizable(false);   
            this.setSize(500,300);   
            this.setLocation(120,10);   
            this.show();   
        
          }   
        public   static   void   main(String   args[]){   
              reportdatacreat   msb =new   reportdatacreat();   
        
        }   
        
      } 
    就是楼上说的那个问题 但不知道怎么修改帮帮忙啊
      

  5.   

    abstracttablemodel
    object
    isempty
      ((vector)vect.elementat(row)).elementat(column);  
    起码这几句一看就是错误的,先把这基本的错误改掉再看别的。
    类名首字母大小
      

  6.   

    大小写的问题我都解决了 问题是编译提示的这几个错误我不知道怎么改啊
    Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    AbstractTablemodel cannot be resolved
    abstracttablemodel cannot be resolved to a type
    The method SetReorderingallowed(boolean) is undefined for the type TableColumnModel at reportdatacreat.<init>(reportdatacreat.java:37)
    at reportdatacreat.main(reportdatacreat.java:97)
      

  7.   

    AbstractTablemodel cannot be resolved 找不到这个东东嘛以后用notepad就别来提问了
      

  8.   

    我也遇到这个问题了 。我的是基本的类型不正确,和jar包的路径不对,重新设置jar包路径解决了。