java swing 问题
String[]table_Heads={"查询号","名称","销售数量","单位","利润","其他"};Vectortable_HeadName=newVector...
String[] table_Heads = {"查询号","名称", "销售数量", "单位","利润","其他"};
Vector table_HeadName = new Vector();
for (int i = 0; i < table_Heads.length; i++) {
table_HeadName.add(table_Heads[i]);
}
怎么设置加入Vector的字体大小 展开
Vector table_HeadName = new Vector();
for (int i = 0; i < table_Heads.length; i++) {
table_HeadName.add(table_Heads[i]);
}
怎么设置加入Vector的字体大小 展开
2个回答
展开全部
public class TableHead {
private String headName;
private int fontSize;
public TableHead(String headName, int fontSize) {
this.headName = headName;
this.fontSize = fontSize;
}
public String getHeadName() {
return headName;
}
public int getFontSize() {
return fontSize;
}
}
自建一个类如上,使用时如下,当然也可以用数组为每个Table Head指定字体大小:
String[] table_Heads = {"查询号","名称", "销售数量", "单位","利润","其他"};
int fontSize = 15;
Vector table_HeadName = new Vector();
for (int i = 0; i < table_Heads.length; i++) {
table_HeadName.add(new TableHead(table_Heads[i], fontSize);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询