From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../TestApp/src/testapp/App.java | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Master/Agile Software Development/TestApp/src/testapp/App.java (limited to 'Master/Agile Software Development/TestApp/src/testapp/App.java') diff --git a/Master/Agile Software Development/TestApp/src/testapp/App.java b/Master/Agile Software Development/TestApp/src/testapp/App.java new file mode 100644 index 0000000..d0e1a55 --- /dev/null +++ b/Master/Agile Software Development/TestApp/src/testapp/App.java @@ -0,0 +1,60 @@ +/* + * Main + */ + +package testapp; + +import java.io.IOException; +import javax.swing.JFrame; +import javax.swing.UIManager; +import java.util.logging.*; + +/** + * + * @author eisenhauer + */ +public class App { + + private static App theInstance = null; + private JFrame mainFrame = null; + private String appPath = ""; + private App() { + try { + this.appPath = Locate.getClassLocation(this.getClass()).getParent(); + // to run from Netbeans + if (appPath.contains("build")) { + appPath = appPath.replace("build", "dist"); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + + public static App getInstance() { + if (theInstance == null) { + theInstance = new App(); + } + return theInstance; + } + private void startApplication() { + // Setup Look and Feel + try { + //UIManager.setLookAndFeel(new com.jgoodies.looks.windows.WindowsLookAndFeel()); + } catch (Exception e) { + e.printStackTrace(); + } + mainFrame = new AppFrame("Webspinne"); + mainFrame.pack(); + mainFrame.setVisible(true); + } + public String getAppPath() { + return appPath; + } + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + App.getInstance().startApplication(); + } + +} -- cgit v1.2.3