01: package com.xoetrope.carousel.survey;
02:
03: import java.awt.Dimension;
04: import java.awt.Toolkit;
05: import javax.swing.JFrame;
06: import javax.swing.UIManager;
07:
08: /**
09: * A standalone application
10: *
11: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
12: * the GNU Public License (GPL), please see license.txt for more details. If
13: * you make commercial use of this software you must purchase a commercial
14: * license from Xoetrope.</p>
15: * <p> $Revision: 1.5 $</p>
16: */
17: public class XSurveyEditorApplication {
18: private XSurveyEditorFrame editorFrame;
19:
20: public XSurveyEditorApplication() {
21: editorFrame = new XSurveyEditorFrame(true, "survey");
22: Dimension screenDim = Toolkit.getDefaultToolkit()
23: .getScreenSize();
24: Dimension size = editorFrame.getSize();
25: int px = (int) (screenDim.width - size.width) / 2;
26: int py = (int) (screenDim.height - size.height) / 2;
27: editorFrame.setLocation(px, py);
28: editorFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
29: editorFrame.setVisible(true);
30: }
31:
32: public XSurveyEditorFrame getFrame() {
33: return editorFrame;
34: }
35:
36: public static void main(String[] args) {
37: try {
38: UIManager.setLookAndFeel(UIManager
39: .getSystemLookAndFeelClassName());
40: new XSurveyEditorApplication();
41: } catch (Exception e) {
42: e.printStackTrace();
43: }
44: }
45: }
|