I want to apply different themes to the components like jframes, panels, components. I would like to create a theme for working with data from files (XML, JSON or the same).
Asked
Active
Viewed 1,152 times
0
-
Check out [Synth L&F](https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html) – Vince May 19 '17 at 17:54
-
thanks. I will read. – Alex Ferreira May 19 '17 at 18:41
-
And what is your question? Telling you about external tools/libraries would be off-topic. Asking how to do it in general a DUP to http://stackoverflow.com/questions/3954616/java-look-and-feel-lf ... so most likely, your question should be put on hold/closed ... – GhostCat May 19 '17 at 19:18
1 Answers
4
At first, you need to consider a different theme like webapp, desktop GUI using swing components or midi app. It will be related with more criteria.
There are some links for L&F:
String srt1 = "javax.swing.plaf.metal.MetalLookAndFeel";
String srt2 = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
String srt3 = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
String srt4 = "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel";
String srt5 = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
String srt6 = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
...
EXAMPLE of USING (for example in constructor):
try {
UIManager.setLookAndFeel(srt1);
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception e) {
e.printStackTrace();
}
JFrame.setDefaultLookAndFeelDecorated(true);

Vasyl Lyashkevych
- 1,920
- 2
- 23
- 38
-
-
"str1" is a string variable of the sources. Also, you can find it easy, for example here: http://www.java2s.com/Product/Java/Swing/Look-And-Feel-LaF.htm – Vasyl Lyashkevych Feb 26 '18 at 10:31