123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package ui.view.main;
- import ui.controller.Control;
- import ui.controller.IndexTranslator;
- import ui.model.Model;
- import javax.swing.*;
- import java.awt.*;
- import java.util.Locale;
- /**
- * The main Class in this Program. The GUI is created in this Class.
- *
- * @author Gruppe14
- *
- */
- public class Main {
- /**
- * main method of this program.
- *
- * @param args standard
- */
- public static void main(String[] args) {
- setLookAndFeel();
- setLocale();
- EventQueue.invokeLater(() -> {
- Model model = new Model();
- Control control = new Control(model);
- GUI view = new GUI(control);
- IndexTranslator.model = model;
- view.setVisible(true);
- });
- }
- private static void setLocale() {
- Locale.setDefault(Locale.US);
- }
- /**
- * This method loads the System LookAndFeel. Except for Linux OS.
- */
- private static void setLookAndFeel() {
- try {
- if (!System.getProperty("os.name").startsWith("Linux")) {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
- | UnsupportedLookAndFeelException e) {
- }
- }
- }
|