Java错误提示------xxx cannot be resolved to be a type

Java错误提示 专栏收录该内容
22 篇文章 0 订阅
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);


}

}
  • 0
    点赞
  • 0
    评论
  • 1
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页

打赏作者

OneCode2World

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值