helloworld.java

来自「FMJ(freedom media for java)是java视频开发的新选择」· Java 代码 · 共 48 行

JAVA
48
字号
package net.sf.fmj.ejmf.examples.genericplayer;/*By Bavo Bruylandt (Http://www.realapplets.com")*/// and now The inevidable "Hello World" example :)// tell the compiler where to find the methods you will use.// required when you create an appletimport java.applet.*;// required to paint on screenimport java.awt.*; // the start of an applet - HelloWorld will be the executable class// Extends applet means that you will build the code on the standard Applet classpublic class HelloWorld extends Applet{// The method that will be automatically called  when the applet is started     public void init()     { // It is required but does not need anything.     } // This method gets called when the applet is terminated// That's when the user goes to another page or exits the browser.     public void stop()     {     // no actions needed here now.     } // The standard method that you have to use to paint things on screen// This overrides the empty Applet method, you can't called it "display" for example.     public void paint(Graphics g)     { //method to draw text on screen // String first, then x and y coordinate.      g.drawString("Hey hey hey",20,20);      g.drawString("Hellooow World",20,40);     }} 

⌨️ 快捷键说明

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