日期:2014-05-20 浏览次数:20749 次
import java.awt.Graphics; import javax.swing.JFrame; public class Tests { public void paint(Graphics g){ } } class B extends JFrame { public B(){ } Tests a=new Tests(); public void dd(Graphics g){ a.paint(g); } //重写JFrame的paint方法在当中调用自子的绘图方法dd() @Override public void paint(Graphics g) { super.paint(g); this.dd(g);// } }