Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Java GUIs that resemble the native Windows look and feel

Is there a better package or external library out there that does a better job than javax.swing at resembling the native Windows look and feel? I want my Java GUIs to resemble the forms I create using C# and the .NET framework. Thanks.

like image 813
TheWolf Avatar asked Dec 01 '22 05:12

TheWolf


2 Answers

SWT comes closest because it actually uses the OS'es native widgets. The downside is that you have to perform some memory management, which is not required with Swing.

Other options include QT with Java, more information on that in this topic: https://stackoverflow.com/questions/422956/java-swing-or-java-qt

and wxWidgets with wx4j: http://en.wikipedia.org/wiki/WxWidgets

like image 144
nkr1pt Avatar answered Dec 04 '22 04:12

nkr1pt


You can select the system look and feel with swing :

public static void main(String[] args) {
    try {
        // Set System L&F
        UIManager.setLookAndFeel(
            UIManager.getSystemLookAndFeelClassName());
    } 
    catch (UnsupportedLookAndFeelException e) {
       // handle exception
    }
    catch (ClassNotFoundException e) {
       // handle exception
    }
    catch (InstantiationException e) {
       // handle exception
    }
    catch (IllegalAccessException e) {
       // handle exception
    }

    new SwingApplication(); //Create and show the GUI.
}

Resources :

  • Oracle.com - How to Set the Look and Feel
  • Substance project

On the same topic :

  • Good-looking Java Swing Look&Feel?
  • How to improve look and feel of JAVA swing GUI?
like image 28
Colin Hebert Avatar answered Dec 04 '22 03:12

Colin Hebert