X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2Flauncher%2FMain.java;h=0d15f438479fae0d5f51c39b5bd477f5ac81f7a6;hb=d5fe10f330481170112c7cc7576d181c982194e1;hp=81cac0ea4646c6800e63fa846d64b0490c158c93;hpb=8ef719db477953b45babc141ed63b6a76244ba90;p=sixth-3d-demos.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java index 81cac0e..0d15f43 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java @@ -1,39 +1,39 @@ /* - * Sixth 3D engine demos. Copyright ©2012-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - */ +*/ package eu.svjatoslav.sixth.e3d.examples.launcher; import javax.swing.*; import java.awt.*; -class Main extends javax.swing.JFrame { +import static java.awt.BorderLayout.CENTER; +import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; - private static final long serialVersionUID = -3679656169594556137L; - private Main() { - super(); - initGUI(); - } +class Main { public static void main(final String[] args) { - SwingUtilities.invokeLater(() -> { - final Main inst = new Main(); - final BorderLayout instLayout = new BorderLayout(); - inst.setLocationRelativeTo(null); - inst.setVisible(true); - inst.getContentPane().setLayout(instLayout); - }); + buildAndShowGuiWindow(); } - private void initGUI() { - getContentPane().add(new MenuPanel()); - pack(); - setSize(390, 300); + /** + * Builds and shows the main window of the application. + */ + private static void buildAndShowGuiWindow() { + JFrame frame = new JFrame("Sixth 3D engine demos"); + + // Keep application running until last frame is closed. + frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE); + + frame.getContentPane().setLayout(new BorderLayout()); + frame.getContentPane().add(new ApplicationListPanel(), CENTER); + frame.setSize(400, 300); + + frame.setLocationRelativeTo(null); // center frame on screen + frame.setVisible(true); } }