Main.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package ui.view.main.old;
  2. import ui.controller.Control;
  3. import javax.swing.*;
  4. import model.IndexTranslator;
  5. import model.Model;
  6. import java.awt.*;
  7. /**
  8. * The main Class in this Program. The GUI is created in this Class.
  9. *
  10. * @author Gruppe14
  11. *
  12. */
  13. public class Main {
  14. /**
  15. * main method of this program.
  16. *
  17. * @param args standard
  18. */
  19. public static void main(String[] args) {
  20. if (!System.getProperty("os.name").startsWith("Linux")) {
  21. loadNotLinuxLookAndFeel();
  22. }
  23. EventQueue.invokeLater(() -> {
  24. try {
  25. Model model = new Model();
  26. Control control = new Control(model);
  27. GUI view = new GUI(control);
  28. IndexTranslator.model = model;
  29. view.getFrmCyberPhysical().setVisible(true);
  30. } catch (Exception e) {
  31. e.printStackTrace();
  32. }
  33. });
  34. }
  35. private static void loadNotLinuxLookAndFeel() {
  36. try {
  37. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  38. } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
  39. | UnsupportedLookAndFeelException e) {
  40. e.printStackTrace();
  41. }
  42. }
  43. }