j_printstate.java.bak

来自「一个十分好的java基础学习的课件」· BAK 代码 · 共 51 行

BAK
51
字号
// ////////////////////////////////////////////////////////
// 
// J_PrintState.java
// 
// Created by Jun-Hai Yong,    on XX xx, xxxx (Date)
// ////////////////////////////////////////////////////////
// Readme:
// Demonstrate the life cycle of an applet.
// ////////////////////////////////////////////////////////
// Using this example, please explicitly refer to the book:
//     Jun-Hai Yong. Programming in Java. 
//     Beijing: Tsinghua University Press, 2004.
// 使用本例子,请注明引用:
//     雍俊海. Java 程序设计. 北京: 清华大学出版社, 2004.
// Please note that the author and publisher make no 
// warranty of any kind on the examples provided.
// ////////////////////////////////////////////////////////

import java.awt.*;
import javax.swing.*;

public class J_PrintState extends JApplet
{
    public void init( )
    { 
        System.out.println("init: Applet begins");
    } // End of method: init

    public void start( )
    { 
        System.out.println("start: Enter applet");
    } // End of method: start

    public void paint(Graphics g)
    { 
        System.out.println("paint: Draw applet");
        g.drawString("Applet Demo", 80, 40);
    } // End of method: paint 

    public void stop( )
    { 
        System.out.println("stop: Leave applet");
    } // End of method: stop

    public void destroy( )
    { 
        System.out.println("destroy: Close applet");
    } // End of method: destroy

} // End of class: J_PrintState

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?