Main.java 843 B

123456789101112131415161718192021222324252627282930313233
  1. package ui.view.main;
  2. import java.awt.EventQueue;
  3. import javax.swing.JPanel;
  4. import javax.swing.UIManager;
  5. import javax.swing.UnsupportedLookAndFeelException;
  6. /**
  7. * The Main class defines the program entry point.
  8. * @author Tom
  9. *
  10. */
  11. public class Main extends JPanel{
  12. public static void main(String[] args) {
  13. loadNotLinuxLookAndFeel();
  14. EventQueue.invokeLater(() -> openMainFrame());
  15. }
  16. public static void openMainFrame() {
  17. MainFrame mainFrame = new MainFrame();
  18. }
  19. private static void loadNotLinuxLookAndFeel() {
  20. try {
  21. if (!System.getProperty("os.name").startsWith("Linux")) {
  22. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  23. }
  24. } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
  25. e.printStackTrace();
  26. }
  27. }
  28. }