Main.java 1.3 KB

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