Hello. I decided to start working with the Swing library (from IDEA in Ubuntu). When working with Form in Designer, the following (rather “stylish”) window is obtained enter image description here

And after compiling and running, the following window appears (no longer so “stylish”) enter image description here

Is there an easy way to make the style of the running window coincide with that in the Form. Or maybe other ways? Thank you in advance!

  • The point is the OS shell. Play with the Unity Tweak Tool. - Denis Zvyagintsev
  • 3
    There is such a thing for the swing look and feel called. Especially for installing different тем . There are several built-in to choose from, but in the idea it may well be its own kind. UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); - Sergey
  • one
    Installation example in the UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAn‌​dFeel"); program UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAn‌​dFeel"); Through setting a property on the command line java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel MyApp - Sergey

1 answer 1

Try to do it -

 try { UIManager.setLookAndFeel(new com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { JOptionPane.showMessageDialog(null, "Error in a LaF of executable file"); 

`on Windows looks pretty stylish - enter image description here