62,615
社区成员
发帖
与我相关
我的任务
分享
private TextField uA = new TextField("0.000"); //A相电压
private TextField uB = new TextField("0.000"); //B相电压
private TextField uC = new TextField("0.000"); //C相电压
private TextField iA = new TextField("0.000"); //A相电流
private TextField iB = new TextField("0.000"); //B相电流
private TextField iC = new TextField("0.000"); //C相电流
private TextField pfA = new TextField("0.000"); //A相功率因数
private TextField pfB = new TextField("0.000"); //B相功率因数
private TextField pfC = new TextField("0.000"); //C相功率因数
private TextField pA = new TextField("0.000"); //A相有功
private TextField pB = new TextField("0.000"); //B相有功
private TextField pC = new TextField("0.000"); //C相有功
private TextField qA = new TextField("0.000"); //A相无功
private TextField qB = new TextField("0.000"); //B相无功
private TextField qC = new TextField("0.000"); //C相无功
private TextField sA = new TextField("0.000"); //A相视在
private TextField sB = new TextField("0.000"); //B相视在
private TextField sC = new TextField("0.000"); //C相视在
ArrayList<String> arrayList = null;
private TextField[] tf = new TextField[18];
add(tf[i]);
出错了
应该是
arrayList.add(tf[i]);
for(int i=0;i<tf.length;i++){
tf[i] = new TextField("0.000");
tf[i].setFont(font);
tf[i].setForeground(Color.blue);
tf[i].setBackground(Color.lightGray);
if(i<=5){
tf[i].setBounds(195, 35+i*70, 100, 235);
}
add(tf[i]);
}
这是我想到方法,请各位大哥指正