Create a Java WEB application that also runs via desktop

Asked

Viewed 898 times

0

Good night to you all.

I’m thinking of developing an application with the following features:

Backend: Java

Frontend(Option 1): Javafx

Frontend(Option 2): HTML5 + CSS3

I want to start the right way, internationalizing the application with Resource Bundle, etc, etc, etc. However, I also want my application to run via desktop, but also accessible via web.

Summarizing my question: What are the tools to develop a Java application that runs via desktop and also via web? My backend changes when developing for one and another? or just the interfaces? I thank you in advance.

Note: I’ve heard of Java Web start, but from what I’ve read it designs a java desktop application for the web, but it doesn’t do otherwise.

[Upshot]

I talked today with a friend and great developer, and set up the following study structure for insertion in the labor market:

1) JAVA

2) JSF

3) MVC

4) JAVASCRIPT + HTML5 + CSS3 + AJAX

I was also able to understand that the ideal Backend works for several front-end, and that there is no universal one, and even if it is possible, it is not commercially feasible because every screen, whether mobile, desktop or web, has its particularities. I’ve seen spectacular pages reduce to home projects simply by developing a web interface without considering the mobile access structure. Facebook itself has difficulty porting desktop browser features to mobile browsers, despite efforts. I think what I could learn in this discussion was that the ideal design model should include a robust backend with programming language and database (in most cases) and a front-end for each type of client (web, desktop, mobile, even access via Lynx console for example). My goal as an aspiring "aspiring programmer" is to maximize my knowledge in Java SE and java EE, and thereby become a development expert for cross-platform.

Thank you all.

  • 1

    Search a little about web service, there is a question with an answer that talks about the structure you will need (https://answall.com/questions/8071/howto connect applicationss-desktop-e-web)

  • 1

    Java is a platform only, Runtime is required to run either on Desktop for Web, there is no "Java for Web" or "Java for Desktop".

1 answer

1


Use HTML5 + CSS3.

The reason is that if you want to program to the web, the ideal is that the user is running your program through the browser, and so, just know the URL of your program and will already be able to access it.

In the case of the desktop, the solution is the same, the only difference is that the address to be accessed will be on localhost or something similar.

HTML5 + CSS3 is widespread and anyone has a browser capable of handling it without you needing to ask the user to install anything.

Javafx on the other hand is strictly for desktop applications, such as Swing and AWT.

The idea was even to allow Javafx to be used for RIA development (Rich Internet Applications), but this did not succeed because it depended on the possibility of running Javafx inside applets. It turns out that all modern browsers discontinued the use of applets, which killed and buried this possibility for good. Therefore, Javafx is left to live only on the desktop.

  • 1

    I have just been reading a very interesting article about Electron: https://www.linuxuncomplicated.com.br/2016/09/saiba-howto create applicationse-css.html. this development tool allows the creation of cross-platform applications, and also allows web applications to be ported to desktop.

  • 1

    @Alexandreguerreiro There are several tools of this type scattered around of all tastes and qualities and certainly some more are being invented right now, but in the end they all generate HTML + JS + CSS to run in the browser. What happens is that these tools can generate everything or part of it for you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.