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.Logger;
7 import javax.swing.UIManager;
8 import javax.swing.UIManager.LookAndFeelInfo;
9 import javax.swing.UnsupportedLookAndFeelException;
10 import org.apache.commons.configuration.ConfigurationException;
11 import yukihane.inqubus.config.Properties;
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 // Properties.INSTANCE.load(path.toString());
27 // } catch (ConfigurationException ex) {
28 // logger.info("コンフィグファイルが無いためデフォルト値で起動");
31 // SwingUtilities.invokeLater(new Runnable() {
34 // public void run() {
35 // final MainFrame frame = new MainFrame();
36 // frame.setVisible(true);
41 public static void main(String args[]) {
42 final FileSystem fileSystem = FileSystems.getDefault();
43 final Path path = fileSystem.getPath("inqubus.xml");
45 Properties.INSTANCE.load(path.toString());
46 } catch (ConfigurationException ex) {
47 logger.info("コンフィグファイルが無いためデフォルト値で起動");
51 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
52 if ("Nimbus".equals(info.getName())) {
53 UIManager.setLookAndFeel(info.getClassName());
57 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
59 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
60 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
61 // System Look & Feel も無いことは無いだろう
64 java.awt.EventQueue.invokeLater(new Runnable() {
67 new MainFrame().setVisible(true);