public void paint(Graphics g){
super.paint(g);
this.init_loading();
for(int ctrow=1;ctrow<=15;ctrow++){ //控制行的输出
for(int ctcol=1;ctcol<=96;ctcol++){
g.setColor(new Color(54,54,255));
if(ctrow%8==0){
g.setColor(Color.BLUE); //控制行输出的颜色
}
if(ctcol %6==0){
g.setColor(Color.BLUE);
}
int strlen1 = f.str.length();
for(int i=0; i<strlen1;i++){
displayString(ctrow,ctcol,i,g,String.valueOf(f.str.charAt(i)),相同变量);
//当ctrow=1,2,3,4,5,6,7,8,ctcol=1,2,3,4,5,6,要传一个相同的变量,最终是到writeToPanel00方法里
//当ctrow=1,2,3,4,5,6,7,8,ctcol=7,8,9,10,11,12时,要传另一个变量,最终是到writeToPanel00方法里 请问怎么实现
}
g.fillRect(xx, yy, 2, 2);
xx =xx+3;
}
yy=yy+3;
xx=2;
}
}
public void displayString(int ctrow,int ctcol,int potion,Graphics g,String font){
int cxx = 6;
int cyy = 0;
cxx = cxx*(potion+1);
cyy = cyy*(potion+1);
if(ctrow<8 && (ctcol<cxx && ctcol>cyy)){
this.writeToPanel00(font, g);
}
}
public void writeToPanel00(String font,Graphics g){
if(font.equals("h")){
if(this.h[idd] == "1"){
g.setColor(Color.WHITE);
}
idd++;
}
}
当ctrow=1,2,3,4,5,6,7,8,ctcol=1,2,3,4,5,6,要传一个相同的变量,最终是到writeToPanel00方法里
当ctrow=1,2,3,4,5,6,7,8,ctcol=7,8,9,10,11,12时,要传另一个变量,最终是到writeToPanel00方法里 请问怎么实现
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货