1 package yukihane.inqubus;
3 import java.nio.file.FileSystem;
4 import java.nio.file.FileSystems;
5 import java.nio.file.Path;
6 import java.util.logging.Level;
7 import java.util.logging.Logger;
8 import javax.swing.UIManager;
9 import javax.swing.UIManager.LookAndFeelInfo;
10 import javax.swing.UnsupportedLookAndFeelException;
11 import org.apache.commons.configuration.ConfigurationException;
12 import yukihane.inqubus.gui.MainFrame;
20 private static final Logger logger = Logger.getLogger(Main.class.getName());
22 public static void main(String args[]) {
23 final FileSystem fileSystem = FileSystems.getDefault();
24 final Path path = fileSystem.getPath("inqubus.xml");
26 Config.INSTANCE.load(path.toString());
27 } catch (ConfigurationException ex) {
28 logger.log(Level.FINE, "コンフィグファイルが無いためデフォルト値で起動", ex);
31 java.awt.EventQueue.invokeLater(new Runnable() {
34 new MainFrame().setVisible(true);
39 private static void setLookAndFeel() {
41 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
42 if ("Nimbus".equals(info.getName())) {
43 UIManager.setLookAndFeel(info.getClassName());
47 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
49 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
50 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
51 // System Look & Feel も無いことは無いだろう