Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's Java Hybrid - Applet + Application?

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 available anymore."

And a rebuttal:

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.

I would like to ask what this Java Hybrid is?

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.

like image 601
Lews Therin Avatar asked Nov 30 '22 05:11

Lews Therin


1 Answers

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.
like image 121
trashgod Avatar answered Dec 10 '22 06:12

trashgod