11c.txt
来自「一本关于JBuilder 应用开发的书籍,希望大家喜欢,其实我没看过的,」· 文本 代码 · 共 50 行
TXT
50 行
package hello;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.rmi.Naming;
import java.rmi.RemoteException;
public class HelloApplet extends Applet {
boolean isStandalone = false;
String message = "blank";
//"obj" is the identifier that we'll use to refer
//to the remote object that implements the "Hello"
//interface
Hello obj = null;
/**Get a parameter value*/
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
/**Construct the applet*/
public HelloApplet() {
}
/**Initialize the applet*/
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
obj = (Hello)Naming.lookup("//" + getCodeBase().getHost()
+ "/HelloServer");
message = obj.sayHello();
}
public void paint(Graphics g){
g.drawString(message, 25, 50);
}
/**Get Applet information*/
public String getAppletInfo() {
return "Applet Information";
}
/**Get parameter info*/
public String[][] getParameterInfo() {
return null;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?