Documentation

The Java™ Tutorials

Trail: Deployment部署

Java rich internet applications (RIA) are applications that have traits similar to desktop applications, but are deployed via the Internet.Java富internet应用程序(RIA)是具有类似于桌面应用程序特性的应用程序,但通过internet部署。Java RIAs may be developed and deployed as Java applets or Java Web Start applications.Java RIA可以作为Java小程序或Java Web Start应用程序开发和部署。

Component-Based Architecture for RIAs基于组件的RIA体系结构

In the past, the decision of whether to deploy a Java rich internet application inside the browser as an applet, or outside the browser as a Java Web Start application, could significantly impact the design of the application.在过去,是将Java富Internet应用程序作为小程序部署在浏览器内部,还是将其作为Java Web Start应用程序部署在浏览器外部的决策可能会对应用程序的设计产生重大影响。With the latest Java Plug-in, this decision has been greatly simplified.有了最新的Java插件,这个决定大大简化了。

Traditionally, applications construct their user interfaces, including the top-level Frame, in the main method.传统上,应用程序使用main方法构建其用户界面,包括顶级FrameThis programming style prevents easy re-deployment of the application in the browser, because it assumes that the application creates its own Frame.这种编程风格防止在浏览器中轻松重新部署应用程序,因为它假定应用程序创建自己的FrameWhen running in the browser as an applet, the applet is the top level container that should hold the user interface for the application.当小程序作为小程序在浏览器中运行时,小程序是顶级容器,应该包含应用程序的用户界面。A top-level Frame is not needed.不需要顶层Frame

Use component-based architecture when designing your Java rich internet application.设计Java富internet应用程序时,请使用基于组件的体系结构Try to organize its functionality into one or more components that can be composed together.尝试将其功能组织成一个或多个可以组合在一起的组件。In this context, the term "component" refers to a GUI element that is a subclass of the AWT Component class, the Swing JComponent class, or another subclass.在此上下文中,术语“组件”指的是作为AWT组件类、Swing JComponent类或其他子类的子类的GUI元素。For example, you could have a top level JPanel which contains other UI components in it (like a combination of more nested JPanels and text fields, combo boxes etc.).例如,您可以有一个顶级JPanel,其中包含其他UI组件(如更多嵌套JPanel和文本字段、组合框等的组合)。With such a design, it becomes relatively easy to deploy the core functionality as an applet or a Java Web Start application.通过这种设计,将核心功能部署为applet或Java Web Start应用程序变得相对容易。

To deploy as a Java applet, you just need to wrap the core functionality in an Applet or JApplet and add the browser specific functionality, if necessary.要部署为Java小程序,只需将核心功能包装在AppletJApplet中,并在必要时添加特定于浏览器的功能。To deploy as a Java Web Start application, wrap the functionality in a JFrame.要部署为Java Web Start应用程序,请将功能包装在JFrame中。

Choosing Between Java Applets and Java Web Start Applications在Java小程序和Java Web Start应用程序之间进行选择

The Rich Internet Applications Decision Guide contains detailed information to help you decide whether to deploy your code as a Java applet or Java Web Start application.富Internet应用程序决策指南包含详细信息,可帮助您决定是将代码部署为Java小程序还是Java Web Start应用程序。

The Self-Contained Application Alternative自包含的应用程序替代方案

Self-contained applications provide a deployment option that does not require a browser.自包含应用程序提供了一个不需要浏览器的部署选项。Users install your application locally and run it similar to native applications.用户在本地安装您的应用程序,并以与本机应用程序类似的方式运行它。Self-contained applications include the JRE needed to run the application, so users always have the correct JRE.自包含的应用程序包括运行应用程序所需的JRE,因此用户始终拥有正确的JRE。

This trail discusses the development and deployment of RIAs and self-contained applications.本教程讨论RIA和自包含应用程序的开发和部署。See What's New for capabilities introduced in various versions of the client Java Runtime Environment (JRE) software.请参阅各种版本的客户端Java运行时环境(JRE)软件中引入的功能的新增功能

Developing and Deploying Java Applets开发和部署Java小程序

Developing and Deploying Java Web Start Applications开发和部署Java Web Start应用程序

Doing More With Java Rich Internet Applications利用Java富Internet应用程序做更多事情

Deployment In-Depth深入部署

Deploying Self-Contained Applications部署自包含的应用程序

Supporting Tools辅助工具

Packaging Programs in JAR Files在JAR文件中打包程序


Previous page: Beginning of Tutorial
Next page: Java Applets