Improved code readability
[sixth-3d-demos.git] / src / main / java / eu / svjatoslav / sixth / e3d / examples / launcher / Main.java
1 /*
2  * Sixth 3D engine demos. Author: Svjatoslav Agejenko. 
3  * This project is released under Creative Commons Zero (CC0) license.
4  *
5 */
6
7 package eu.svjatoslav.sixth.e3d.examples.launcher;
8
9 import javax.swing.*;
10 import java.awt.*;
11
12 import static java.awt.BorderLayout.CENTER;
13 import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
14
15
16 class Main {
17
18     public static void main(final String[] args) {
19         buildAndShowGuiWindow();
20     }
21
22     /**
23      * Builds and shows the main window of the application.
24      */
25     private static void buildAndShowGuiWindow() {
26         JFrame frame = new JFrame("Sixth 3D engine demos");
27
28         // Keep application running until last frame is closed.
29         frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
30
31         frame.getContentPane().setLayout(new BorderLayout());
32         frame.getContentPane().add(new ApplicationListPanel(), CENTER);
33         frame.setSize(400, 300);
34
35         frame.setLocationRelativeTo(null); // center frame on screen
36         frame.setVisible(true);
37     }
38
39 }