diff --git a/lib/commons-lang3-3.4.jar b/lib/commons-lang3-3.4.jar new file mode 100644 index 0000000..8ec91d4 Binary files /dev/null and b/lib/commons-lang3-3.4.jar differ diff --git a/src/org/dclermonte/siba/gui/SibaGUI.java b/src/org/dclermonte/siba/gui/SibaGUI.java index b7a711a..5578b2a 100644 --- a/src/org/dclermonte/siba/gui/SibaGUI.java +++ b/src/org/dclermonte/siba/gui/SibaGUI.java @@ -27,6 +27,8 @@ import java.awt.EventQueue; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; import java.util.Locale; import java.util.ResourceBundle; @@ -44,6 +46,32 @@ import org.apache.commons.lang3.StringUtils; public class SibaGUI { + public static class GUIToolBox + { + + /** + * + * @return + */ + public static List availableLookAndFeels() + { + List result; + + // + result = new ArrayList(); + + // + for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) + { + // + result.add(info.getName()); + } + + // + return result; + } + } + public static void main(final String[] args) { EventQueue.invokeLater(new Runnable() @@ -101,11 +129,11 @@ public class SibaGUI } }); // Remove BOLD on default font. - UIManager.put("swing.boldMetal", Boolean.TRUE); + UIManager.put("swing.boldMetal", Boolean.FALSE); // Set LookAndFeel. System.out.println("System lookAndFeel property:" + System.getProperty("swing.defaultlaf")); - System.out.println("Available lookAndFeel: " + UIManager.getInstalledLookAndFeels().toString()); + System.out.println("Available lookAndFeel: " + GUIToolBox.availableLookAndFeels().toString()); System.out.println("System lookAndFeel: " + UIManager.getSystemLookAndFeelClassName()); System.out.println("Current lookAndFeel: " + UIManager.getLookAndFeel().getName()); @@ -121,7 +149,7 @@ public class SibaGUI System.out.println("Failed to set the system LookAndFeel."); } } - else if (UIManager.getInstalledLookAndFeels().toString().contains("GTK+")) + else if (GUIToolBox.availableLookAndFeels().toString().contains("GTK+")) { try {