Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 770
Cláudio Avatar asked Sep 15 '14 20:09

Cláudio


People also ask

What is Java look and feel?

With the growth in Java framework, new changes were introduced to make the UI better and thus giving developer opportunity to enhance the look of a Java Swing Application. “Look” refers to the appearance of GUI widgets and “feel” refers to the way the widgets behave.

Which method is used to change the look and feel of the Java GUI application?

To programmatically specify a L&F, use the UIManager. setLookAndFeel() method with the fully qualified name of the appropriate subclass of LookAndFeel as its argument.


2 Answers

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.
}
like image 110
dkatzel Avatar answered Oct 04 '22 02:10

dkatzel


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.
like image 29
jefflunt Avatar answered Oct 04 '22 02:10

jefflunt