A继承b b继承c如果想从c中直接引用a中的重载方法怎么办?难道用super.super.方法名()
如果我想在界面上显示10 但是从1变成2然后变成3~~~~~就渐变成10我怎么编
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Xianshi extends JFrame implements Runnable {
private JLabel label;
private Container cp;
private int i;
public void gg(){
try{
for(i=1;i<=10;i++){
label.setText(String.valueOf(i));
Thread.sleep(500);
if(i==10)
i=1;
//if(i>10)i=1;
}
}catch(Exception e){};
}
public void run(){
}
//private Font font;
public Xianshi(){
//Thread t=new Thread("xianshi");
label=new JLabel("number show");
cp=getContentPane();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(200,200);
cp.add(label);
label.setHorizontalAlignment(label.CENTER);
}
public static void main(String[] args){
Xianshi xx=new Xianshi();
xx.setVisible(true);
xx.gg();
}
}
[此贴子已经被作者于2006-4-26 18:11:09编辑过]