java repaint和paint方法的重写
repaint不是会调用paint方法吗,,为啥没进去paint方法打印出来。。。publicclassMyFrameextendsJFrame{publicstatic...
repaint不是会调用paint方法吗,,为啥没进去paint方法打印出来。。。
public class MyFrame extends JFrame {
public static void main(String[] args){
new MyFrame();
}
public MyFrame(){
this.setSize(500, 500);
this.repaint();
this.setVisible(true);
}
public void print(Graphics g) {
System.out.println(">>>>>>>>>>>>>>>>");
super.print(g);
}
} 展开
public class MyFrame extends JFrame {
public static void main(String[] args){
new MyFrame();
}
public MyFrame(){
this.setSize(500, 500);
this.repaint();
this.setVisible(true);
}
public void print(Graphics g) {
System.out.println(">>>>>>>>>>>>>>>>");
super.print(g);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询