Main.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package ui.view;
  2. import java.awt.EventQueue;
  3. import javax.swing.UIManager;
  4. import javax.swing.UnsupportedLookAndFeelException;
  5. import ui.controller.*;
  6. import ui.model.*;
  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
  18. * standard
  19. */
  20. public static void main(String[] args) {
  21. if (!System.getProperty("os.name").startsWith("Linux"))
  22. // *Design
  23. try {
  24. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  25. } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
  26. // TODO Auto-generated catch block
  27. e.printStackTrace();
  28. }
  29. else
  30. try {
  31. UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
  32. } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
  33. | UnsupportedLookAndFeelException e) {
  34. // TODO Auto-generated catch block
  35. e.printStackTrace();
  36. }
  37. EventQueue.invokeLater(new Runnable() {
  38. public void run() {
  39. try {
  40. Model model = new Model();
  41. Control control = new Control(model);
  42. GUI view = new GUI(control);
  43. view.getFrmCyberPhysical().setVisible(true);
  44. } catch (Exception e) {
  45. e.printStackTrace();
  46. }
  47. }
  48. });
  49. }
  50. }