1 56 57 package org.objectstyle.cayenne.dataview.dvmodeler; 58 59 import java.util.Iterator ; 60 import java.util.List ; 61 62 import javax.swing.JFrame ; 63 import javax.swing.UIManager ; 64 65 import com.jgoodies.looks.plastic.PlasticLookAndFeel; 66 import com.jgoodies.looks.plastic.PlasticTheme; 67 import com.jgoodies.looks.plastic.PlasticXPLookAndFeel; 68 69 74 public class Main { 75 76 public static final String DEFAULT_THEME_NAME = "Sky Bluer"; 79 public static final String DEFAULT_LAF_NAME = PlasticXPLookAndFeel.class.getName(); 80 81 public static void main(String [] args) { 82 try { 83 UIManager.setLookAndFeel(DEFAULT_LAF_NAME); 84 85 PlasticTheme foundTheme = themeWithName(DEFAULT_THEME_NAME); 86 if (foundTheme != null) { 87 PlasticLookAndFeel.setMyCurrentTheme(foundTheme); 88 } 89 } 90 catch (Throwable th) { 91 th.printStackTrace(); 92 } 93 94 JFrame instance = new DVModelerFrame(); 95 96 instance.setSize(800, 600); 97 instance.validate(); 98 instance.setLocationRelativeTo(null); 99 instance.setVisible(true); 100 } 101 102 static PlasticTheme themeWithName(String themeName) { 103 List availableThemes = PlasticLookAndFeel.getInstalledThemes(); 104 for (Iterator i = availableThemes.iterator(); i.hasNext();) { 105 PlasticTheme aTheme = (PlasticTheme) i.next(); 106 if (themeName.equals(aTheme.getName())) { 107 return aTheme; 108 } 109 } 110 111 return null; 112 } 113 } | Popular Tags |