Using Swing in Java EE

1

Good afternoon, when the programmer works with java WEB, it generates graphical interface using the javax.swing class as in Desktop?

    
asked by anonymous 30.12.2015 / 19:49

1 answer

1

TL; DR

No, when talking about Java Web, even more in Java EE, interfaces are built using HTML, CSS and JavaScript.

But this is not the full story ...

Java Applets

In fact it is possible to some extent to use Swing on a web page using Java Applets, which are Java programs that run on the user's machine, inside the browser, and can use Swing components.

It's like having a desktop window inside the browser.

However, Java Applets is an outdated technology, which no one else recommends using, even Chrome stopped supporting a few months ago. The main problems are related to security and also to the fact that this completely goes beyond the concept of a web system.

Java Network Launch Protocol (JNPL)

Another technology that attempts to make Java Desktop applications easier to use is JNPL, which allows a desktop application, possibly based on Swing, to be automatically downloaded and executed by the user without the need for installation or configuration.

It is not uncommon for web systems to bridge a JNDI application, that is, you log in to the web system and then redirect to a JNPL descriptor that then loads the desktop system into your local JVM.

Almost Swing #sqn

To take advantage of the familiarity that many Swing developers have, some Java Web solutions try to take advantage of the same concept of componentization, such as Vaadin , Wicket , GWT or even JSF, although the latter is now a bit closer to HTML than the others.

Basically they use some template or even API that allows you to build and manipulate components via code, however these components are implemented with HTML, CSS and JavaScript.

It is claimed that such use of components increases productivity, since the developer does not have to worry about design . However, such frameworks are known to have several difficulties in extending components or compatibility with browsers, often causing the developer to have to dig into scripts and tags at some point.

    
31.12.2015 / 04:12