View Javadoc
1 package org.neuclear.commons.swing; 2 3 import com.jgoodies.plaf.Options; 4 import com.l2fprod.common.util.OS; 5 6 import javax.swing.*; 7 8 /* 9 * The NeuClear Project and it's libraries are 10 * (c) 2002-2004 Antilles Software Ventures SA 11 * For more information see: http://neuclear.org 12 * 13 * This library is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU Lesser General Public 15 * License as published by the Free Software Foundation; either 16 * version 2.1 of the License, or (at your option) any later version. 17 * 18 * This library is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 * Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public 24 * License along with this library; if not, write to the Free Software 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 */ 27 28 /*** 29 * User: pelleb 30 * Date: Apr 21, 2004 31 * Time: 10:14:53 AM 32 */ 33 public class SwingTools { 34 35 public static void setLAF() { 36 try { 37 if (OS.isMacOSX()) { 38 System.setProperty("com.apple.macos.useScreenMenuBar", "true"); 39 } else if (OS.isWindows2003() || OS.isWindowsXP()) { 40 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 41 } else { 42 UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); 43 UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE); 44 } 45 46 } catch (Exception e) { 47 // Likely PlasticXP is not in the class path; ignore. 48 } 49 50 } 51 52 private static boolean isMac() { 53 return UIManager.getSystemLookAndFeelClassName().equals("apple.laf.AquaLookAndFeel"); 54 } 55 56 private SwingTools() { 57 }; 58 59 private static boolean ismac = isMac(); 60 }

This page was automatically generated by Maven