What's Java Hybrid - Applet + Application?

后端 未结 2 829
误落风尘
误落风尘 2020-11-22 07:03

And how can I write one?

From comments to my reply, this followed:

\"What we had in the old days - An Applet and Application - is not availab

2条回答
  •  感动是毒
    2020-11-22 07:15

    A hybrid applet/application simply abstracts the initialization of two top-level containers, JFrame and JApplet. Examples are seen here, here and here.

    Addendum: How does that work?

    • 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 static fireup() method and a WindowListener for error reporting.

提交回复
热议问题