r/learnjava • • Jun 27 '20

What technology should I learn?

Hi! I’m a beginner and I want to learn how to provide a user interface for my java program. I looked online and am seeing many things like swing/ spring/spring boot/javaFX and am very confused as to where I should begin, or what is completely outdated and should not be trying to learn. Appreciate any advice thanks!!

43 Upvotes

18 comments sorted by

15

u/Bunnymancer Jun 27 '20

Spring Boot is where to start. Add something like Thymeleaf to get the UI part while still being in the "Springiverse"

2

u/mnmchocchip Jun 27 '20

Thank you I will look at spring boot!

3

u/VincentxH Jun 27 '20

Agree about Spring boot, but would advise to forget about Thymeleaf and go for plain html + JavaScript. That makes http requests and the problems of web dev development far more explicit.

1

u/kaisrevenge Jun 27 '20

Agreed. You’ll learn SO much by going for plain HTML and JavaScript.

3

u/Jo_Han_Solo Jun 27 '20

Maybe check out the “Play” framework for creating MVC web apps.

I used it in one of my earlier jobs and it seems pretty good for integrating your java code into something that can be displayed on the web.

However, if you need your UI to run native and not in a browser this might be the wrong choice but in today’s day and age I think it’s largely acceptable that a UI for an app runs in a browser :)

Though I see many jobs around asking for Spring and Spring Boot. I have no experience with it personally but it seems lucrative to learn.

Best of luck!

1

u/mnmchocchip Jun 27 '20

Thank you I will definitely check it out!!

1

u/[deleted] Jun 27 '20

I think it depends on what type your application is. If you develop a desktop app you can use java swing or java fx. But it does not look really good imo.

The more modern approach is to use the browser to interact with your application. It's more work but I think it's worth it. You can use spring boot as your backend and html/css/javascript for the UI section. Since spring boot is a server application it can serve the frontend files like other application servers. It's also possible to use angular for the frontend task, compile and copy it into the spring project to serve it like a plain html site.

1

u/mnmchocchip Jun 27 '20

The latter sounds very complex. I would have to learn about servlets? Is swing still being used today? It seems like it has a less steep learning curve and I might want to try that but read that it’s deprecated. Do you recommend learning it?

4

u/gonzohst93 Jun 27 '20

Swing and javafx are both unused in industry but I learned them in school still. In industry I use spring boot with Angular front end

1

u/[deleted] Jun 27 '20

As i said, for desktop applications you can use it of course but it's very ugly imo. IIRC JavaFx is the "newer version" and has replaced java swing. Programming is complex, there is no "easy way" to do the things you want to achieve. I think the best way would be diving into angular, the "heroes tutorial" on their homepage is really good.

1

u/Sonnilon81 Jun 27 '20

Am I the only person that actually likes Java Swing/"old school" apps?

IMO the Metal interface looks great to this day, and meanwhile you can get Swing apps to look just like a native app (by e.g. using GTK theme in Linux).

I personally hate the "browserfercation" of everything, gimme native apps any day :-)

3

u/[deleted] Jun 27 '20

I'm like the "browserfication" of everything. I think it's easier to have eveything in one place. But if you like oldschool things ok. I don't condemn you for this :)

0

u/Xemorr Jun 27 '20

Browserfication is really inefficient with resources, surely? I think it's a pretty bad trend. It's like this https://en.wikipedia.org/wiki/Andy_and_Bill%27s_law

1

u/argio Jun 27 '20

We still use swing at the office but when we start a new project it's with angular frontend. For the backend: if it's small project spring boot. If it's a complex application with a lot of features javaEE (and jakarta EE in the near future)

1

u/VincentxH Jun 27 '20

I'd forget about angular if you don't know the basics, it overcomplicates things.

1

u/MistyQuisty Jun 27 '20

I have only used swing but I highly recommend never touching it and sticking to one of the others like javafx. But if you do just remembered, the time you spend trying to correctly position an element because of layout Managers can NEVER be recovered

1

u/bicika Jun 28 '20

Start with spring and spring boot. And maybe you should focus and restful and microservices architecture.