题目
JTable(Vector rowData,Vector columnNames)
package table;
public class grade
{
String name;
int china;
int math;
int all;
boolean ok;
public grade(String name,int china,int math,int all,boolean ok)
{
this.name = name;
this.china = china;
this.math = math;
this.all = all;
this.ok = ok;
}
}
package table;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.*;
public class table
{
public table()
{
JFrame f=new JFrame();
Vector va=new Vector();
grade gr1=new grade("网鹏",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
grade gr2=new grade("网",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
grade gr=new grade("鹏",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
va.addElement(gr);
va.addElement(gr2);
va.addElement(gr1);
Vector ve=new Vector();<
package table;
public class grade
{
String name;
int china;
int math;
int all;
boolean ok;
public grade(String name,int china,int math,int all,boolean ok)
{
this.name = name;
this.china = china;
this.math = math;
this.all = all;
this.ok = ok;
}
}
package table;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.*;
public class table
{
public table()
{
JFrame f=new JFrame();
Vector va=new Vector();
grade gr1=new grade("网鹏",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
grade gr2=new grade("网",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
grade gr=new grade("鹏",new Integer(82),new Integer(91),new Integer(100),new Boolean(true));
va.addElement(gr);
va.addElement(gr2);
va.addElement(gr1);
Vector ve=new Vector();<
提问时间:2021-03-28
答案
你的Vector va=new Vector()里面的数据类型都是grade的,而grade又不是数组,所以你的va里面都是一个一个的grade对象,JTable不会自动解析你的grade的构造方法,把它变成String数组,所以你要手动提取出gr1,gr2,gr3中你所...
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
热门考点