mysuperapplet.java

来自「learning java的源代码。书中每个实例都有相关的代码example。」· Java 代码 · 共 30 行

JAVA
30
字号
//file: MySuperApplet.javaimport java.applet.Applet;import java.awt.*;import javax.swing.*;public class MySuperApplet extends JApplet {    // applet's own code, including constructor    // and init() and start(  ) methods    public static void main( String [] args ) {        // instantiate the applet        JApplet theApplet = new MySuperApplet(  );        // create a window for the applet to run in        JFrame theFrame = new JFrame(  );        theFrame.setSize(200,200);        // place the applet in the window        theFrame.getContentPane(  ).add("Center", theApplet);        // start the applet        theApplet.init(  );        theApplet.start(  );        // display the window        theFrame.setVisible(true);    }}

⌨️ 快捷键说明

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