java怎么使用JLabel显示数据?
publicclassTest{publicstaticvoidmain(String[]args){Stringaa[]={"公共的","受保护的","私有的"};in...
public class Test {
public static void main(String[]args){
String aa[]={"公共的","受保护的","私有的"};
int b=(int)(Math.random()*aa.length);
String c=aa[b];
System.out.println(c);
JFrame a=new JFrame();
a.setVisible(true);
a.setTitle("ii");
a.setSize(420,320);
a.setLocation(200,200);
a.setResizable(false);
a.setLayout(new FlowLayout());
JLabel q=new JLabel();
q.get(c);
}
}
q.get(c);这里要怎么修改? 展开
public static void main(String[]args){
String aa[]={"公共的","受保护的","私有的"};
int b=(int)(Math.random()*aa.length);
String c=aa[b];
System.out.println(c);
JFrame a=new JFrame();
a.setVisible(true);
a.setTitle("ii");
a.setSize(420,320);
a.setLocation(200,200);
a.setResizable(false);
a.setLayout(new FlowLayout());
JLabel q=new JLabel();
q.get(c);
}
}
q.get(c);这里要怎么修改? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询