From 2d671a12658bee0f17834a2b972e7d37a2127f45 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Sun, 8 Feb 2009 18:33:05 +0000 Subject: [PATCH] Nimbus look and feel is not fully supported on many linux platforms: * changing default look and feel to cross platform l&f on linux systems --- tools/cooja/java/se/sics/cooja/GUI.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index 207631298..51addc532 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.101 2009/01/08 15:43:49 fros4943 Exp $ + * $Id: GUI.java,v 1.102 2009/02/08 18:33:05 fros4943 Exp $ */ package se.sics.cooja; @@ -945,7 +945,12 @@ public class GUI extends Observable { /* Nimbus */ try { - UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); + String osName = System.getProperty("os.name").toLowerCase(); + if (osName.startsWith("linux")) { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + } else { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); + } return; } catch (Exception e) { }