Java错误提示------xxx cannot be resolved to be a type
package com.jtable_1;
import javax.swing.JTpackage com.jtable_1;
import javax.swing.JTable;
import java.awt.*;
import javax.swing.*;
//当提示:xxx cannot be resolved to be a type 时,即:编译器不识别这个类,那么,1.是没引包 2.是类名写错了
import javax.swing.table.*;
public class Demo_jtable extends JFrame
{
JPanel jp1;
JTable jtable;
public static void main (String[] args)
{
new Demo_jtable();
}
Demo_jtable()
{
String []colname={“name”,”age”,”address”};
jp1=new JPanel();
jtable=new JTable(new DefaultTableModel(10,10));
jp1.add(jtable);
this.add(jp1);
this.setLayout(new GridLayout());
this.setSize(300,300);
this.setLocation(100, 100);
this.setVisible(true);
}
}
able;
import java.awt.*;
import javax.swing.*;
//当提示:xxx cannot be resolved to be a type 时,即:编译器不识别这个类,那么,1.是没引包 2.是类名写错了
import javax.swing.table.*;
public class Demo_jtable extends JFrame
{
JPanel jp1;
JTable jtable;
public static void main (String[] args)
{
new Demo_jtable();
}
Demo_jtable()
{
String []colname={“name”,”age”,”address”};
jp1=new JPanel();
jtable=new JTable(new DefaultTableModel(10,10));
jp1.add(jtable);
this.add(jp1);
this.setLayout(new GridLayout());
this.setSize(300,300);
this.setLocation(100, 100);
this.setVisible(true);
}
}package com.jtable_1;
import javax.swing.JTable;
import java.awt.*;
import javax.swing.*;
//当提示:xxx cannot be resolved to be a type 时,即:编译器不识别这个类,那么,1.是没引包 2.是类名写错了
import javax.swing.table.*;
public class Demo_jtable extends JFrame
{
JPanel jp1;
JTable jtable;
public static void main (String[] args)
{
new Demo_jtable();
}
Demo_jtable()
{
String []colname={“name”,”age”,”address”};
jp1=new JPanel();
jtable=new JTable(new DefaultTableModel(10,10));
jp1.add(jtable);
this.add(jp1);
this.setLayout(new GridLayout());
this.setSize(300,300);
this.setLocation(100, 100);
this.setVisible(true);
}
}
还没有评论,来说两句吧...