helloword1.java~1~

来自「提供了常用的JAVA技术的示例」· JAVA~1~ 代码 · 共 38 行

JAVA~1~
38
字号
package helloword1;import java.awt.*;import java.awt.Graphics;import java.applet.Applet;public class helloword1 extends Applet {  public void init() {    String text="helloworld !";  }  public static void main(String[] args) {    helloword1 applet = new helloword1();    applet.isStandalone = true;    Frame frame;    frame = new Frame() {      protected void processWindowEvent(WindowEvent e) {        super.processWindowEvent(e);        if (e.getID() == WindowEvent.WINDOW_CLOSING) {          System.exit(0);        }      }      public synchronized void setTitle(String title) {        super.setTitle(title);        enableEvents(AWTEvent.WINDOW_EVENT_MASK);      }    };    frame.setTitle("Applet Frame");    frame.add(applet, BorderLayout.CENTER);    applet.init();    applet.start();    frame.setSize(400,320);    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();    frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);    frame.setVisible(true);  }}

⌨️ 快捷键说明

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