4 * @author willCodeForFood
8 import java.awt.event.WindowAdapter;
9 import java.awt.event.WindowEvent;
10 import java.rmi.RMISecurityManager;
12 import javax.swing.JButton;
13 import javax.swing.JFrame;
14 import javax.swing.JLabel;
15 import javax.swing.JPanel;
16 import javax.swing.SwingConstants;
17 import javax.swing.UIManager;
19 import configuration.ConfigXML;
22 @SuppressWarnings("deprecation")
23 public class StartWindow extends JFrame {
25 private static final long serialVersionUID = 1L;
27 private JPanel jContentPane = null;
28 private JButton boton2 = null;
29 private JButton boton3 = null;
30 private static configuration.ConfigXML c;
32 //public static ApplicationFacadeInterface facadeInterface;
33 private JLabel lblNewLabel;
35 public static void main(String[] args) {
37 StartWindow a = new StartWindow();
42 c=ConfigXML.getInstance();
44 System.setProperty("java.security.policy", c.getJavaPolicyPath());
46 System.setSecurityManager(new RMISecurityManager());
48 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
50 c=configuration.ConfigXML.getInstance();
52 }catch (com.db4o.ext.DatabaseFileLockedException e) {
53 a.lblNewLabel.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
54 a.lblNewLabel.setForeground(Color.RED);
55 System.out.println("Error in StartWindow: "+e.toString());
56 } catch (Exception e) {
57 a.lblNewLabel.setText("Error: "+e.toString());
58 a.lblNewLabel.setForeground(Color.RED);
59 System.out.println("Error in StartWindow: "+e.toString());
66 * This is the default constructor
69 public StartWindow() {
72 addWindowListener(new WindowAdapter() {
74 public void windowClosing(WindowEvent e) {
80 //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
86 * This method initializes this
90 private void initialize() {
91 // this.setSize(271, 295);
92 this.setSize(495, 290);
93 this.setContentPane(getJContentPane());
94 this.setTitle("Rural Houses");
98 * This method initializes jContentPane
100 * @return javax.swing.JPanel
102 private JPanel getJContentPane() {
103 if (jContentPane == null) {
104 jContentPane = new JPanel();
105 jContentPane.setLayout(null);
106 jContentPane.add(getLblNewLabel());
107 jContentPane.add(getBoton2());
108 jContentPane.add(getBoton3());
114 * This method initializes boton2
116 * @return javax.swing.JButton
118 private JButton getBoton2() {
119 if (boton2 == null) {
120 boton2 = new JButton();
121 boton2.setBounds(0, 74, 479, 93);
122 boton2.setText("Login");
123 boton2.addActionListener(new java.awt.event.ActionListener() {
124 public void actionPerformed(java.awt.event.ActionEvent e) {
125 // C?digo cedido por la universidad
126 JFrame a = new LoginGUI();
135 * This method initializes boton3
137 * @return javax.swing.JButton
139 private JButton getBoton3() {
140 if (boton3 == null) {
141 boton3 = new JButton();
142 boton3.setBounds(0, 165, 479, 87);
143 boton3.setText("Query availability");
144 boton3.addActionListener(new java.awt.event.ActionListener() {
145 public void actionPerformed(java.awt.event.ActionEvent e) {
146 // C?digo cedido por la universidad
147 //JFrame a = new QueryAvailabilityWindow();
148 JFrame a = new QueryAvailabilityGUI2();
158 private JLabel getLblNewLabel() {
159 if (lblNewLabel == null) {
160 lblNewLabel = new JLabel("Select option:");
161 lblNewLabel.setBounds(0, 0, 479, 63);
162 lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 13));
163 lblNewLabel.setForeground(Color.BLACK);
164 lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
169 } // @jve:decl-index=0:visual-constraint="0,0"