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

柔情只为你懂 2022-08-03 03:09 295阅读 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 条评论,295人围观)

还没有评论,来说两句吧...

相关阅读