Commit | Line | Data |
---|---|---|
70f5b2bb KL |
1 | /* |
2 | * Jexer - Java Text User Interface | |
7d4115a5 KL |
3 | * |
4 | * License: LGPLv3 or later | |
5 | * | |
70f5b2bb KL |
6 | * This module is licensed under the GNU Lesser General Public License |
7 | * Version 3. Please see the file "COPYING" in this directory for more | |
8 | * information about the GNU Lesser General Public License Version 3. | |
7d4115a5 KL |
9 | * |
10 | * Copyright (C) 2015 Kevin Lamonte | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or | |
13 | * modify it under the terms of the GNU Lesser General Public License | |
14 | * as published by the Free Software Foundation; either version 3 of | |
15 | * the License, or (at your option) any later version. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, but | |
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | * General Public License for more details. | |
21 | * | |
22 | * You should have received a copy of the GNU Lesser General Public | |
23 | * License along with this program; if not, see | |
24 | * http://www.gnu.org/licenses/, or write to the Free Software | |
25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
26 | * 02110-1301 USA | |
70f5b2bb KL |
27 | * |
28 | * @author Kevin Lamonte [kevin.lamonte@gmail.com] | |
29 | * @version 1 | |
7d4115a5 | 30 | */ |
70f5b2bb | 31 | package jexer.demos; |
2420f903 | 32 | |
0d47c546 | 33 | import jexer.TApplication; |
a06459bd | 34 | |
70f5b2bb | 35 | /** |
e3dfbd23 KL |
36 | * This class is the main driver for a simple demonstration of Jexer's |
37 | * capabilities. | |
7d4115a5 KL |
38 | */ |
39 | public class Demo1 { | |
40 | /** | |
41 | * Main entry point. | |
42 | * | |
cc99cba8 | 43 | * @param args Command line arguments |
7d4115a5 | 44 | */ |
cc99cba8 | 45 | public static void main(final String [] args) { |
8e688b92 | 46 | try { |
a4406f4e KL |
47 | // Swing is the default backend on Windows unless explicitly |
48 | // overridden by jexer.Swing. | |
49 | TApplication.BackendType backendType = TApplication.BackendType.XTERM; | |
50 | if (System.getProperty("os.name").startsWith("Windows")) { | |
51 | backendType = TApplication.BackendType.SWING; | |
52 | } | |
53 | if (System.getProperty("jexer.Swing") != null) { | |
54 | if (System.getProperty("jexer.Swing", "false").equals("true")) { | |
55 | backendType = TApplication.BackendType.SWING; | |
56 | } else { | |
57 | backendType = TApplication.BackendType.XTERM; | |
58 | } | |
59 | } | |
60 | DemoApplication app = new DemoApplication(backendType); | |
61 | (new Thread(app)).start(); | |
8e688b92 KL |
62 | } catch (Exception e) { |
63 | e.printStackTrace(); | |
64 | } | |
7d4115a5 KL |
65 | } |
66 | ||
67 | } |