X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2Flauncher%2FMain.java;h=f972085d9f7781d47f3dd09fb9530590f2ebeb92;hb=006585b5853331fe4e78699b5cdc70fd5fdccbc9;hp=512f30c8f711dd9cd71d463fabe6930bcf9f30db;hpb=b2c4a8941f5a618b83913fa1a1456d1ef2f77e77;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 512f30c..f972085 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,43 +1,36 @@ /* - * Sixth 3D engine demos. Copyright ©2012-2016, 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 { - private static final long serialVersionUID = -3679656169594556137L; - - private Main() { - super(); - initGUI(); +class Main { + public static void main(final String[] args) { + buildAndShowGuiWindow(); } /** - * Auto-generated main method to display this JFrame + * Builds and shows the main window of the application. */ - 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); - }); - } + private static void buildAndShowGuiWindow() { + JFrame frame = new JFrame("Sixth 3D engine demos"); + + // Keep application running until last frame is closed. + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + + frame.getContentPane().setLayout(new BorderLayout()); + frame.getContentPane().add(new ApplicationListPanel(), BorderLayout.CENTER); + frame.setSize(400, 300); - private void initGUI() { - getContentPane().add(new MenuPanel()); - pack(); - setSize(390, 300); + frame.setLocationRelativeTo(null); // center frame on screen + frame.setVisible(true); } }