1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Public class HelloUniverse extends Applet { private SimpleUniverse u = null; public BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup(); …. return objRoot; } public void init() { Canvas3D c = new Canvas3D(config); add("Center", c); …. u.addBranchGraph(scene); } …. } |
1 2 3 4 5 6 7 8 9 | <HTML> <HEAD> <TITLE>Hello, Universe!</TITLE> </HEAD> <BODY BGCOLOR="#000000"> <applet align=middle code="HelloUniverse.class" width=256 height=256> </applet> </BODY> </HTML> |
1 2 3 4 5 6 7 8 9 10 11 12 | <%@ page contentType="text/html; charset=GBK" %> <HTML> <HEAD> <TITLE>Hello, Universe!</TITLE> </HEAD> <BODY BGCOLOR="#000000"> <%int i=300;%> <%float j=i*(new java.util.Random()).nextFloat();%> <applet align=middle code="HelloUniverse.class" width=<%=j%> height=<%=j%>> </applet> </BODY> </HTML> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <%@ page contentType="text/html; charset=GBK" %> <%@ page import="javax.ejb.*" %> <%@ page import="java.rmi.*"%> <%@ page import="javax.rmi.PortableRemoteObject"%> <%@ page import="javax.naming.*"%> <%@ page import="java.util.Properties"%> <HTML> <HEAD> <TITLE>Hello, Universe!</TITLE> </HEAD> <BODY BGCOLOR="#000000"> <% try{ Properties properties = null; Context context = new InitialContext(properties); Object ref = context.lookup("Customer"); EJBHome home= (EJBHome)PortableRemoteObject.narrow(ref,CustomerHome.class); CustomerHome home=(CustomerHome)home; Customer customer= home.findByPrimaryKey("1000000"); String data = customer.getData(); } catch(Exception e){e.printStackTrace();} %> <applet align=middle code="HelloUniverse.class" width=200 height=200> <param name="Data" value=<%=data%>> </applet> </BODY> </HTML> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |