r/java • u/technroll • Mar 22 '16
You think Java is slow and heavy? The fastest web server in the world is written in Java!
r/java • u/technroll • Mar 22 '16
r/java • u/martypitt • Nov 14 '25
I was doing some client work recently. They're a bank, where most of their engineering is offshored one of the big offshore companies.
The offshore team had to access everything via virtual desktops, and one of the restrictions was no virtualisation within the virtual desktop - so tooling like Docker was banned.
I was really surprsied to see modern JVM development going on, without access to things like TestContainers, LocalStack, or Docker at all.
To compound matters, they had a single shared dev env, (for cost reasons), so the team were constantly breaking each others stuff.
How common is this? Also, curious what kinds of workarounds people are using?
r/java • u/Vegetable-Pack9292 • Jan 25 '24
I have been programming for about 5 years now, and I started with Java then moved to Python before returning back to using a bit of both. After getting a good tour of Python, I have come to appreciate the static typed nature of Java. I find the way OOP works in Java to be much more aesthetically pleasing to look at than python code. Of course, there are exceptions to this rule when concepts get more complicated.
r/java • u/Elegant_Farmer_3548 • Jul 05 '26
I've been messing with OpenGL (LWJGL) and decided to build something fun
What do y'all think?
r/java • u/Ewig_luftenglanz • Sep 09 '25
The status of the Jep changed: Draft -> Submitted. Let's hope it makes it for OpenJDK 26 or 27
r/java • u/[deleted] • Aug 26 '22
I think that those things make the code easier to read. Am I crazy for thinking like that?
r/java • u/ulldma • Jan 06 '20
r/java • u/CrowSufficient • Jun 18 '26
I'm the author of an ebook designed to help people pass a Java technical interview. Its a high level reference with explanations for over 150 technical questions, which I put together after helping people on r/javahelp. I have a free giveaway every few months and Amazon is letting me do it again this week. Feel free to grab a copy, its very useful to help you prepare before a junior or senior level interview!
If you want to read a sample chapter without downloading the ebook, I put one up here: Java Interview Guide. The direct link on amazon is here: Amazon Page
If you find it useful, I would be thrilled if you left a positive review on Amazon or tell anyone who might benefit from the free giveaway. Also, I recently launched a print version which is available for people who like holding physical copies. Feel free to ask me any questions!
PS - People outside of the US, try changing the amazon subdomain to your country to find your free version.
r/java • u/MysteryForumGuy • Dec 19 '14
r/java
•
u/gottlikeKarthos
•
Aug 30 '26
Hello! After 6 years of development, I am happy to finally release of Norse Expansion Medieval RTS for Android! You can get it on Google Play: https://play.google.com/store/apps/details?id=com.norseexpansion.norseexpansion
It only took about 240k lines of code, almost all Java (and some C++ for an Audioengine). Graphics are rendered in OpenGL.
This project made me love Java and hate the surrounding technology like gradle and Androidstudio.
r/java • u/Thihup • Aug 02 '24
r/java • u/gufranthakur • Aug 17 '25
I have used Java swing over the past few years, and It felt like the best desktop framework to me. I tried Avalonia, CustomTkinter, egui, Electron but always sticked with Swing.
People will say it's old and outdated, and yeah, they are right. No good support for animations, No in-built chart library, no new updates. But it got the job done for me, and I impressed people at work as they went "You made that in Java?"
People will also say the UI looks bad. I agree. So I used flatLaf. Just 4 lines of maven code, and one line of Java code to transform my swing app visually. I love Flatlaf.
This post will feel like a Swing vs FX debate (it technically is) but I will not be talking much about the obvious differences like "it's more modern" or "it's faster". I will be diving a bit deeper towards the things that normally don't get talked about, and will be focusing on developer experience, and most importantly how the experience was, migrating from Swing to FX. Final verdict at the end if you want to save time
What I liked about Swing :-
Simple and easy to use. need a button to do something? button.addActionListener(e -> doThing());
UI by code. I dislike XML/XAML/FXML styled UI and always prefer to code UI by hand, even the complex ones
Built into the JDK. No extra dependencies. It felt native
Performant. Window resizing aside, I had it do some heavy tasks in background threads and I NEVER thought "Damn this is slow", even without optimizations. I even ran these apps on my college PC's (they have low specs) and it was smooth.
No bugs. I know this is a obvious one, but I just like how stable and ready it is
Custom Graphics. I just loved Graphics2D, always loved using it with JPanels.
Once again, simplicity. I love simplicity. I don't want weird symbols and a flashy way to do something just because it's the modern way and add syntatic sugar. It's simple to use Swing and I get done things quickly and efficiently, I love it.
But I faced some obvious issues with it (it's why I switched to JavaFX). There were some things I disliked about Swing, while they weren't THAT bad, I wish swing could improve them
What I did not like about Swing
No new updates. While swing had most of the things I needed, same can't be said for everyone else. Even for me, I had to use third party libraries for some Swing components. It wasn't difficult, just 4 lines of maven XML and it was in my project. Still I wish Swing had more
JTable. I don't know, I never liked working with them, always had GPT/Claude to do it. Thankfully I only had to use JTable for one project
A bit verbose at times.rootPanel.add(myComponent, BorderLayout.WEST); is verbose and unneccesary, as opposed to JavaFX : rootPane.setRight(myComponent);
If you had to modify JComponents, whether it be the UI or anything, I always found it hectic to modify it. I am not talking about the font, background, or size, but the attributes that you cant normally modify using methods provided. For example, I wanted to implement an 'X' closing button on my JTabbedPane panes, took me a while to get it done right
No active community. This is obvious as everyone has moved to web, with even desktop apps being made in JS, but still I would really love an active Swing community.
(The biggest one for me) Font scaling across OS's. Once I switched to Ubuntu from windows, my Swing app looked completely different, button sizes were weird, some components were straight up not visible. (Got cut out) and my app looked like a mess. This is when I decided I would try JavaFX.
While all these issues could be mitigated with workarounds, I did not like it, and kind of goes against the main reason why I loved swing, simplicity. I figured to make more complex and better apps, I would need a better framework at the cost of simplicity. So I tried JavaFX.
So I began using JavaFX. I did not go through any tutorials. Instead asked ChatGPT to teach me "What's the equivalent of ___ in JavaFX" and jumped straight to building projects. Unfortunately they are internal office tools I developed at work and I am not able to share it. (Note, I did not use any FXML in any of my projects)
Things I liked about JavaFX
Cleaner API. I love how I can just
getChildren.addAll(c1, c2, c3);,
BorderPane's setCenter(), setRight() methods.
VBox and HBox, instead of creating a Jpanel, then setting it's layout which. Saves me one line of code. Minor, but it matters to me
Allignment and positioning of components in Panels. Felt better than swing.
just better methods overall. (Don't remember all of them for now)
Better styling options. My favorite one is how I can use Gradient with just one line of inline CSS. Where in swing I had to use paintComponent(), make a GradientPaint object, apply the paint and draw it.
Better UI. I used AtlantaFX (Cupertino Dark) and I loved it way more than Swing's Flatlaf (While I know this isn't a valid argument for JavaFX vs Swing, I am focusing on developer experience. So I will count this one as a plus)
Built in charts library, This is something I always wished Swing had.
Better animation support. I don't use animations much in my apps, but having a spinning progress bar, chart animations, it was nice to do it with minimal effort.
Gets updated.
(Biggest one for me) Font and component sizes were finally consistent across OS's. I had a colleague who used Windows to test my apps, and oh boy, the happiness I felt when I saw the app being perfectly rendered, just like it was on my Ubuntu.
JavaFX seemed like a overall better Swing (It is) but there were things that I did not like about it
Things I did not like about JavaFX
Not bundled with the JDK. I liked how Swing is bundled in the JDK. This may not sound like a problem at first, until you start facing the JavaFX runtime components missing during deployment or testing on other machines
FXML. Not a fan of XML to begin with, but I never liked SceneBuilder. No proper dark mode, the entire Controller and fx:id thing just felt odd to me, I ended up coding all the UI by Java code which was way better for me.
AnimationTimer. I was using the Notch/Minecraft game loop in one of my swing app and it worked perfectly fine, smooth 120 fps. I rewrote the same application in JavaFX and the performance was straight up horrible. around 10fps. I had to ditch Animation timer and just rendered it whenever I needed to. The movement isn't as smooth as my swing app but at least it doesn't visually lag now
Community is okay? While it's not dead as swing, JavaFX is not something you will see often on the internet. And that is mainly because of the state of Desktop Applications in the IT industry. Not exactly a flaw of JavaFX
(Biggest one for me) Deploying. Oh boy, the absolute pain and suffering it caused me to deploy them. It was really overwhelming for me as I had to now deploy my apps and show it at work, and I had limited time. Countless stackoverflow forums, claude/GPT prompts and I could never get it right. Until u/xdsswar helped me out with the most simple solution. HUGE thanks to him, saved me at work. I was actually planning to rewrite all my FX apps in Swing that time
The deploying experience almost made me go back to swing but thankfully I managed to get it right, right around deadline. I will make a seperate reddit post about it in the future.
My Final verdict
JavaFX is better than Swing. There I said it. This does not mean swing sucks, I will forever be grateful to swing for getting me addicted and good at desktop application development.
The migrating experience was not bad at all. Mainly because I coded my JavaFX apps in a very swing like way (No FXML, pure code) but it was smooth. I only had to look up a few methods and got used to it really quickly. Took me like a week to get used to JavaFX. A lot of API and methods are almost the same. JavaFX does some things better as well.
In the future I hope JavaFX gets more updates, And I expect great community efforts from the Java and FX community. I have high expectations from CheerpJ.
I hope this was a good read to you. Thank you for taking out the time to read my post. Please let me know if you have any questions
r/java • u/pimterry • Aug 09 '22