Is there a java look and feel based on the flat design concept? [duplicate]
Asked Answered
G

2

12

I have 5 java systems for engineering whose UI were developed using Swing.

We started the development of these systems about 10 years ago and they have about 300K lines of code each. All these systems are in production environment.

One question that bother us about the UI of these systems is that they look old when compared with large available UIs of cell phones, tablets and web sites.

What do cell phones, tablets and web sites UI have in common ? Their look is based on the flat design concept.

So, we´re starting a research to find low cost alternatives to give to our systems a modern look oriented to flat design.

The first option we thought was to search a java L&F that is implemented based in the flat design concept. But We did not find one.

Does anyone knows if there is a java look and feel based, specifically, on the flat design concept ?

Best regards, Cláudio.

Gorgonzola answered 15/9, 2014 at 20:10 Comment(11)
Swing L&F can change the colors and the borders and the spacing and even some of the rendering .. but really the only way to create a modern UI is to throw the "traditional"/Swing UI away and start over :< And "starting over" is not a "low cost" strategy.Rackrent
If just looking for a different L&F, see https://mcmap.net/q/120161/-java-look-and-feel-l-amp-f-closed - maybe one of those are suitable (or can be modified such that they are suitable). And if not .. might have to rethink either "low cost" or making the UI feel iModern.Rackrent
Just want to mention that only changing the look and feel might not solve your problem completly. If you have many forms that use absolute layout (which is often the case in old business applications) you might have to change them, because textboxes and stuff becomes bigger or smaller. So keep that in mind if you have many forms in your application.At
@Lars, we avoid absolute layout always as possible. ;-)Peroxidize
@user2864740, I think that JavaFX killed Java/Swing and I´m not confident that I will find a L&F to my question...Peroxidize
@Gorgonzola Swing isn't dead. Java is not dead. JavaFX is simply another runtime/framework leveraging the JVM. However, it is a non-trivial conversion (read: "high cost") to drop Swing and use a different UI framework, whatever it is.Rackrent
Also consider letting the user choose the preferred L&F, as suggested here.Lawabiding
@Rackrent Yeah Java is not dead. But Swing is almost dead. When was the last significant feature update in Swing? :-\ I think that what makes Swing alive is the fact that there are many big systems implemented with it and the cost to migrate them to a modern UI solution, like JavaFX/CSS, is high (I totally agree with You)!Peroxidize
@Lawabiding I think that your suggestion is not related to my question, that is specific about the search for a Java L&F based in the flat design concept.Peroxidize
I understand; my comment was a design suggestion.Lawabiding
The 'duplicate' question link doesn't mention flat design once. Another case of over zealous editing on SO.Procrustes
F
7

There isn't a pre-built one, and UIs in Swing are...well...one of the most painful experiences in development I've ever had. UI is so inherently platform-specific that cross-platform UIs are a pipe dream for any semi-complex UI. The only place it works is if your UI is basically a menu bar and a surface onto which you draw your own UI.

That said, I think long-term you're probably looking into custom UI and widget work on some level, and though that would be a lot of custom UI tool work, the tradeoff is that at least you would control the UI from that point forward, could keep it up-to-date as you go along, and you wouldn't have to worry as much about what Java decides is good UI design.

Some possible options, none of which are going to be without major pain:

  1. Choose one of the two built-in L&F options, or set it to be the platform default (your app looks like the native platform), though you will have to debug the app on every platform separately to make sure the UI works consistently. At least with this option, if you set it to use the platform default, the app will look approximately like a native app on whatever OS it's on.
  2. Look into SWT - probably not worth it in the long run - you're just trading one set of less-than-idea situations for another, I think, but good to at least be educated about your options.
  3. Style the L&F with CSS - never tried this myself - but maybe worth a look. But personally, I would avoid investing any more time binding your application to Swing if you can avoid it. It's just one of those atrocious desktop experiences, as you've seen.
  4. Deliver your app as a web application, which I'm sure is a major re-architecting, and just have users access it through a browser. I realize that this is probably the "nuclear option", and totally unrealistic, but just throwing it out there.
  5. Suck it up and let your app continue to look like crap. There are worse fates in the world.
Fretful answered 15/9, 2014 at 20:27 Comment(8)
A concise and practical analysis, @jefflunt! We actually do the option 1 (plataform default). I think that We have to start preparing our migration to option 3 (JavaFX and CSS in Java 8). The problem is that our customer has a delayed policy to update Java in the production environment.Peroxidize
After all answers I have read, I conclude that there is not a L&F based in the flat design concept yet...Peroxidize
@Gorgonzola Based on your requirement, I believe you will migrate (have migrated?) to JavaFX sooner or later...Hurt
@FranklinYu Our bet has been on web development (html, css, bootstrap and angular).Peroxidize
@Gorgonzola So you went for the "nuclear option"??Hurt
@FranklinYu Sorry I did not understand what You mean about "nuclear option". :-| But We´re migrating our systems to web development. We´re mantaining our Java RMI server, but adding incrementally REST services. Our clients are being completely developed from the ground. We think it will allow us to be more competitive.Peroxidize
@Gorgonzola The "nuclear option" was mentioned in this answer :DHurt
Ok, @FranklinYu! =)Peroxidize
S
4

A quick way to make an old swing app look new is to change its Look and Feel.

The Nimbus look and feel looks OK enter image description here

Check out the Oracle Tutorial on Look and Feel to learn how to change it or create your own.

All you have to do to change your look and feel is to add a few lines of code to your app.

Here's how to change to Nimbus:

try {
    //recommended way to set Nimbus LaF because old versions of Java 6
    //don't have it included
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
       if ("Nimbus".equals(info.getName())) {
           UIManager.setLookAndFeel(info.getClassName());
           break;
        }
    }
} catch (Exception e) {
    // If Nimbus is not available, you can set the GUI to another look and feel.
}
Sestet answered 15/9, 2014 at 20:24 Comment(1)
dkatzel, Nimbus is not compatible with the flat design concept. :-|Peroxidize

© 2022 - 2024 — McMap. All rights reserved.