什么是Java的混合 - 小程序+应用程序? [英] What's Java Hybrid - Applet + Application?
问题描述
和我怎么能写一个?
从评论到我的回复,这遵循:
From comments to my reply, this followed:
我们曾在过去 - 一个applet和应用 - 不再提供
"What we had in the old days - An Applet and Application - is not available anymore."
和反驳:
垃圾。它[一个applet和应用程序]被称为混合动力车,并活得很好。问一个单独的问题,如果你想澄清。
Rubbish. It [An Applet and Application] is called an hybrid, and is alive and well. Ask on a separate question if you would like clarification.
我想问一下这个Java混合动力是什么?
我已经搜查,但由于某些原因无法找到任何东西有用的信息,那就是活得很好。我也许用微客这样的关键词可能是一个原因。
I have searched but for some reason can't find any useful information for something that is "alive and well". The keywords I used maybe slightly off so that could be a reason.
推荐答案
一个的混合的小程序/应用程序只是抽象的two顶层容器,的JFrame
和 JApplet的
。例子可见这里,的这里和这里。
A hybrid applet/application simply abstracts the initialization of two top-level containers, JFrame
and JApplet
. Examples are seen here, here and here.
附录:?如何运作的
- 例如暴露了一个工厂方法,
createGUI()
,并将其添加返回面板到现存顶层容器。 - href=\"https://sites.google.com/site/drjohnbmatthews/subway\">第二提供了一个静态的 initContainer()方法,传递封闭顶层容器作为参数。</ li>
- 创建
类混合
有静态fireup()
方法和的WindowListener
错误报告。 - 创建
- The first example exposes a factory method,
createGUI()
, and it adds the returned panel to the extant top-level container. - The second provides a static
initContainer()
method, passing the enclosing top-level container as a parameter. - The third creates a
class Hybrid
that has a staticfireup()
method and aWindowListener
for error reporting.
这篇关于什么是Java的混合 - 小程序+应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!