Skip to content

Instantly share code, notes, and snippets.

@Romain-P
Created June 8, 2014 19:20
Show Gist options
  • Save Romain-P/0b414fb4d4462e04e2c8 to your computer and use it in GitHub Desktop.
Save Romain-P/0b414fb4d4462e04e2c8 to your computer and use it in GitHub Desktop.
main class
package org.heater.core;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.heater.core.plugin.PluginManager;
import org.heater.gui.GuiModule;
import org.heater.gui.HeaterFrame;
import javax.swing.*;
import java.awt.*;
public class Main {
public static void main(String[] args) {
//trying to set the default looking of system
etablishingLookAndFeel();
//initializing plugins
PluginManager manager = new PluginManager().initialize();
//creating injector
Injector injector = Guice.createInjector(new DefaultModule(), new GuiModule(), manager.getModule());
//launching gui
EventQueue.invokeLater(() -> {
//initializing frame
HeaterFrame frame = injector.getInstance(HeaterFrame.class).initialize();
//installing plugins
manager.installPlugins();
//Set to visible
frame.setVisible(true);
//initializing logger dialog
injector.getInstance(Logger.class).initialize();
});
}
private static void etablishingLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment