widgetsapplet.java
来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 71 行
JAVA
71 行
package org.jnode.test.gui;
import java.applet.Applet;
import java.awt.Image;
/**
* Insert the type's description here.
* Creation date: (2/2/04 11:42:12 PM)
* @author: Kishore
*/
public class Widgetsapplet extends Applet {
public static Image img1 = null;
/**
* Returns information about this applet.
* @return a string of information about this applet
*/
public String getAppletInfo() {
return "widgetsapplet\n" +
"\n" +
"\n" +
"@author: Kishore\n" +
"email: pra_kis@yahoo.com\n" +
"";
}
/**
* Initializes the applet.
*/
public void init() {
super.init();
try {
/* Load the Image */
img1 = this.getImage(this.getDocumentBase(), "spirit.jpg");
// img1 = this.getImage(this.getCodeBase(), "spirit.jpg");
//System.out.println(img1+" with DocumentBase");
if (img1 == null) {
img1 = this.getImage(this.getCodeBase(), "spirit.jpg");
}
//System.out.println(temp+" with CodeBase");
} catch (Exception e) {
System.out.println("unable to retrive image spirit.jpg" + e);
}
AWT_WTTest.testWidgets_and_Layouts(true);
}
/**
* Starts the applet when it is run as an application
* @param args an array of command-line arguments
*/
public static void main(java.lang.String[] args) {
Widgetsapplet applet = new Widgetsapplet();
java.awt.Frame frame = new java.awt.Frame("Applet");
frame.add("Center", applet);
frame.setSize(350, 250);
frame.show();
applet.init();
applet.start();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?