View Javadoc
1   /******************************************************************************
2    * CreateAccountDialog.java - Manage the Create New Account dialog
3    * $Id$
4    * 
5    * BuckoFIBS - Backgammon by BuckoSoft
6    * Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.
7    * 
8    * $Log$
9    * Revision 1.5  2011/09/23 03:00:31  dick
10   * If it's a newbie, then only have one profile for simplicity.
11   *
12   * Revision 1.4  2011/05/31 19:37:03  dick
13   * Fix cvs link.
14   *
15   * Revision 1.3  2010/03/03 13:12:21  inim
16   * Replaced (c) sign in comment mangled by CVS default encoding back to UTF-8
17   *
18   * Revision 1.2  2010/03/03 12:19:49  inim
19   * Moved source to UTF8 encoding from CP1252 encoding. To this end all source files' (c) message was updated to "Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.". This replaces the (c) sign to UTF8, and adds the new year 2010.
20   *
21   * Revision 1.1  2010/02/04 05:57:53  inim
22   * Mavenized project folder layout
23   *
24   * Revision 1.8  2009/01/28 18:15:10  dick
25   * Prettier cvs link in the javadoc.
26   *
27   * Revision 1.7  2009/01/18 05:04:33  dick
28   * The owner is a JFrame, not a JDialog.
29   *
30   * Revision 1.6  2009/01/07 19:55:23  dick
31   * Wire up the ProfileSelector.
32   *
33   * Revision 1.5  2009/01/06 08:07:28  dick
34   * Use the server/port panel.
35   * Display status as we fill out the form.
36   *
37   * Revision 1.4  2009/01/06 02:03:25  dick
38   * Monitor the filling out of the form and report status.
39   *
40   * Revision 1.3  2009/01/05 22:32:23  dick
41   * Hide the profiles if they are not enabled.
42   *
43   * Revision 1.2  2009/01/05 07:16:09  dick
44   * @see moved to .../account
45   *
46   * Revision 1.1  2009/01/05 07:09:53  dick
47   * ConnectToServerDialog and CreateAccountDialog moved to account.
48   *
49   * Revision 1.1  2009/01/04 20:00:51  dick
50   * Framework for the Create New Account dialog.
51   *
52   */
53  package com.buckosoft.fibs.BuckoFIBS.gui.account;
54  
55  import java.awt.Color;
56  import java.awt.Dimension;
57  import java.awt.Font;
58  import java.awt.GridBagConstraints;
59  import java.awt.GridBagLayout;
60  import java.awt.Insets;
61  import java.awt.SystemColor;
62  import java.util.regex.Pattern;
63  
64  import javax.swing.BorderFactory;
65  import javax.swing.JButton;
66  import javax.swing.JDialog;
67  import javax.swing.JFrame;
68  import javax.swing.JLabel;
69  import javax.swing.JPanel;
70  import javax.swing.JPasswordField;
71  import javax.swing.JTextArea;
72  import javax.swing.JTextField;
73  import javax.swing.JTextPane;
74  import javax.swing.border.TitledBorder;
75  
76  import com.buckosoft.fibs.BuckoFIBS.BFProperties;
77  import com.buckosoft.fibs.BuckoFIBS.CommandDispatcher;
78  
79  /** Manage the Create New Account dialog.
80   * @author Dick Balaska
81   * @since 2009/01/03
82   * @version $Revision$ <br> $Date$
83   * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/main/java/com/buckosoft/fibs/BuckoFIBS/gui/account/CreateAccountDialog.java">cvs CreateAccountDialog.java</a>
84   */
85  public class CreateAccountDialog extends JDialog implements CreateAccountStatusInterface, ProfileSelectorNotifier {
86  	private static final long serialVersionUID = 1L;
87  	private	CommandDispatcher	commandDispatcher;
88  	private	BFProperties		properties;
89  	Pattern pat = Pattern.compile("[A-Za-z_]+");  //  @jve:decl-index=0:
90  
91  	private JPanel jPanel = null;
92  	private JPanel jPanel1 = null;
93  	private JPanel jPanel2 = null;
94  	private JLabel jLabel = null;
95  	private JLabel jLabel1 = null;
96  	private JTextField jTextFieldUserName = null;
97  	private JLabel jLabel2 = null;
98  	private JLabel jLabel3 = null;
99  	private JPasswordField jPasswordField0 = null;
100 	private JLabel jLabel4 = null;
101 	private JPanel jPanelPasswordLabel = null;
102 	private JLabel jLabel5 = null;
103 	private JPasswordField jPasswordField1 = null;
104 	private JButton jButtonCreate = null;
105 	private JButton jButtonCancel = null;
106 	private JPanel jButtonPanel = null;
107 	private JPanel jPanelStatus = null;
108 	private JTextArea jTextAreaStatus = null;
109 	private ProfileSelectorPanel jPanelProfile = null;
110 	private JLabel jLabelProfile = null;
111 	private JTextPane jTextPaneStatus = null;
112 	private ServerPortSelectorPanel jPanelServerSelector = null;
113 	/**
114 	 * This method initializes 
115 	 * 
116 	 */
117 	public CreateAccountDialog() {
118 		super();
119 		initialize();
120 	}
121 
122 	public CreateAccountDialog(JFrame owner, CommandDispatcher commandDispatcher) {
123 		super(owner, true);
124 		this.commandDispatcher = commandDispatcher;
125 		this.properties = commandDispatcher.getProperties();
126 		initialize();
127 		this.setLocationRelativeTo(owner);
128 		boolean b = this.properties.isAllowMultiplePersonalities();
129 		this.jPanelProfile.setVisible(b);
130 		this.jLabelProfile.setVisible(b);
131 		if (this.properties.isNewbie()) {
132 			this.jPanelProfile.setVisible(false);
133 			this.jLabelProfile.setVisible(false);
134 			this.jLabel2.setVisible(false);
135 			this.getJPanelServerSelector().setVisible(false);
136 		}
137 	}
138 
139 
140 	/**
141 	 * This method initializes this
142 	 * 
143 	 */
144 	private void initialize() {
145         this.setSize(new Dimension(407, 294));
146         this.setContentPane(getJPanel());
147         this.setTitle("Create New Account");
148 			
149 	}
150 
151 	private void createNewAccountButtonActionPerformed(java.awt.event.ActionEvent evt) {
152 		int profileId = this.jPanelProfile.getSelectedProfile();
153 //		this.properties.setServerName(profileId,this.jP)
154 		this.properties.setUserName(profileId, this.jTextFieldUserName.getText());
155 		this.properties.setPassword(profileId, new String(this.jPasswordField0.getPassword()));
156 		commandDispatcher.dispatch(CommandDispatcher.Command.REGISTER_NEW_USER, this);
157 	}
158 
159 	private void cancelButtonAction() {
160 		this.setVisible(false);
161 		dispose();
162 		commandDispatcher.dispatch(CommandDispatcher.Command.SHOW_CONNECTION_DIALOG);
163 	}
164 
165 	private void userNameKeyTyped(java.awt.event.KeyEvent evt) {
166 		checkActivateCreate();
167 		
168 	}
169 	private void password0KeyTyped(java.awt.event.KeyEvent evt) {
170 		checkActivateCreate();
171 		
172 	}
173 	private void password1KeyTyped(java.awt.event.KeyEvent evt) {
174 		checkActivateCreate();		
175 	}
176 
177 	private	void caretChanged(javax.swing.event.CaretEvent e) {
178 		checkActivateCreate();		
179 		
180 	}
181 	private void checkActivateCreate() {
182 		if (this.jButtonCreate == null)
183 			return;
184 		this.jButtonCreate.setEnabled(false);
185 		String userName = this.jTextFieldUserName.getText();
186 		if (userName.length() < 3) {
187 			setStatus("User Name must be at least 3 characters");
188 			return;
189 		}
190 		if (!pat.matcher(userName).matches()) {
191 			setStatus("Username can have only upper and lower case letters and the underscore");
192 			return;
193 		}
194 		char[] password = this.jPasswordField0.getPassword();
195 		if (password.length == 0) {
196 			setStatus("Enter a password");
197 			return;
198 		}
199 		char[] password1 = this.jPasswordField1.getPassword();
200 		if (password1.length == 0) {
201 			setStatus("Enter your password again");
202 			return;
203 		}
204 		boolean passwordMismatch = false;
205 		if (password.length != password1.length)
206 			passwordMismatch = true;
207 		else {
208 			for (int i=0; i<password.length; i++)
209 				if (password[i] != password1[i]) {
210 					passwordMismatch = true;
211 					break;
212 				}
213 		}
214 		if (passwordMismatch) {
215 			setStatus("You must enter the same password twice");
216 			return;
217 		}
218 		setStatus("");
219 		this.jButtonCreate.setEnabled(true);
220 	}
221 	
222 	public void setStatus(String s) {
223 		this.jTextPaneStatus.setText(s);
224 	}
225 
226 	/* (non-Javadoc)
227 	 * @see com.buckosoft.fibs.BuckoFIBS.gui.account.CreateAccountStatusInterface#onRegisterFailure()
228 	 */
229 	@Override
230 	public void onRegisterFailure() {
231 		this.jButtonCreate.setEnabled(false);
232 	}
233 
234 	/* (non-Javadoc)
235 	 * @see com.buckosoft.fibs.BuckoFIBS.gui.account.CreateAccountStatusInterface#onRegisterSuccess()
236 	 */
237 	@Override
238 	public void onRegisterSuccess() {
239 		this.setVisible(false);
240 		dispose();
241 	}
242 
243 	/* (non-Javadoc)
244 	 * @see com.buckosoft.fibs.BuckoFIBS.gui.account.ProfileSelectorNotifier#profileChanged()
245 	 */
246 	@Override
247 	public void profileChanged() {
248 		int profileId = this.properties.getSelectedProfile();
249 		this.jTextFieldUserName.setText(this.properties.getUserName(profileId));
250 		this.jPasswordField0.setText(this.properties.getPassword(profileId));
251 		this.jPasswordField1.setText(this.properties.getPassword(profileId));
252 		if (this.jPanelServerSelector != null)
253 			this.jPanelServerSelector.setServerName(this.properties.getServerName(profileId));
254 	}
255 
256 	/**
257 	 * This method initializes jPanel	
258 	 * 	
259 	 * @return javax.swing.JPanel	
260 	 */
261 	private JPanel getJPanel() {
262 		if (jPanel == null) {
263 			GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
264 			gridBagConstraints18.fill = GridBagConstraints.BOTH;
265 			gridBagConstraints18.gridy = 2;
266 			gridBagConstraints18.weightx = 1.0;
267 			gridBagConstraints18.weighty = 1.0;
268 			gridBagConstraints18.gridx = 0;
269 			GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
270 			gridBagConstraints31.gridx = 0;
271 			gridBagConstraints31.fill = GridBagConstraints.BOTH;
272 			gridBagConstraints31.weighty = 1.0;
273 			gridBagConstraints31.gridy = 3;
274 			GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
275 			gridBagConstraints21.gridx = 0;
276 			gridBagConstraints21.fill = GridBagConstraints.HORIZONTAL;
277 			gridBagConstraints21.weightx = 0.0;
278 			gridBagConstraints21.insets = new Insets(4, 0, 4, 0);
279 			gridBagConstraints21.gridy = 3;
280 			jLabel1 = new JLabel();
281 			jLabel1.setText("User Name:");
282 			jLabel = new JLabel();
283 			jLabel.setText("Create a new account on FIBS. ");
284 			GridBagConstraints gridBagConstraints = new GridBagConstraints();
285 			gridBagConstraints.gridx = 0;
286 			gridBagConstraints.weighty = 2.0;
287 			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
288 			gridBagConstraints.weightx = 1.0;
289 			gridBagConstraints.gridy = 1;
290 			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
291 			gridBagConstraints1.gridx = 0;
292 			gridBagConstraints1.fill = GridBagConstraints.BOTH;
293 			gridBagConstraints1.gridwidth = 1;
294 			gridBagConstraints1.weightx = 1.0;
295 			gridBagConstraints1.gridy = 0;
296 			jPanel = new JPanel();
297 			jPanel.setLayout(new GridBagLayout());
298 			jPanel.add(getJPanel1(), gridBagConstraints1);
299 			jPanel.add(getJPanel2(), gridBagConstraints);
300 			jPanel.add(getJButtonPanel(), gridBagConstraints21);
301 			jPanel.add(getJPanelStatus(), gridBagConstraints31);
302 			jPanel.add(getJTextPaneStatus(), gridBagConstraints18);
303 		}
304 		return jPanel;
305 	}
306 
307 	/**
308 	 * This method initializes jPanel1	
309 	 * 	
310 	 * @return javax.swing.JPanel	
311 	 */
312 	private JPanel getJPanel1() {
313 		if (jPanel1 == null) {
314 			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
315 			gridBagConstraints2.gridx = -1;
316 			gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL;
317 			gridBagConstraints2.anchor = GridBagConstraints.CENTER;
318 			gridBagConstraints2.gridy = -1;
319 			jPanel1 = new JPanel();
320 			jPanel1.setLayout(new GridBagLayout());
321 			jPanel1.add(jLabel, gridBagConstraints2);
322 		}
323 		return jPanel1;
324 	}
325 
326 	/**
327 	 * This method initializes jPanel2	
328 	 * 	
329 	 * @return javax.swing.JPanel	
330 	 */
331 	private JPanel getJPanel2() {
332 		if (jPanel2 == null) {
333 			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
334 			gridBagConstraints6.gridx = 1;
335 			gridBagConstraints6.gridy = 1;
336 			GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
337 			gridBagConstraints17.gridx = 0;
338 			gridBagConstraints17.anchor = GridBagConstraints.EAST;
339 			gridBagConstraints17.gridy = 0;
340 			jLabelProfile = new JLabel();
341 			jLabelProfile.setText("Select Profile:");
342 			GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
343 			gridBagConstraints16.gridx = 1;
344 			gridBagConstraints16.fill = GridBagConstraints.HORIZONTAL;
345 			gridBagConstraints16.gridy = 0;
346 			GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
347 			gridBagConstraints12.fill = GridBagConstraints.HORIZONTAL;
348 			gridBagConstraints12.gridy = 5;
349 			gridBagConstraints12.weightx = 1.0;
350 			gridBagConstraints12.insets = new Insets(4, 4, 4, 0);
351 			gridBagConstraints12.gridx = 1;
352 			GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
353 			gridBagConstraints11.gridx = 0;
354 			gridBagConstraints11.gridy = 1;
355 			GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
356 			gridBagConstraints10.gridx = 0;
357 			gridBagConstraints10.gridy = 5;
358 			jLabel4 = new JLabel();
359 			jLabel4.setText("Repeat");
360 			GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
361 			gridBagConstraints8.fill = GridBagConstraints.BOTH;
362 			gridBagConstraints8.gridy = 3;
363 			gridBagConstraints8.weightx = 1.0;
364 			gridBagConstraints8.insets = new Insets(4, 4, 4, 0);
365 			gridBagConstraints8.gridx = 1;
366 			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
367 			gridBagConstraints7.gridx = 0;
368 			gridBagConstraints7.anchor = GridBagConstraints.EAST;
369 			gridBagConstraints7.gridy = 3;
370 			jLabel3 = new JLabel();
371 			jLabel3.setText("Password:");
372 			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
373 			gridBagConstraints5.gridx = 0;
374 			gridBagConstraints5.anchor = GridBagConstraints.EAST;
375 			gridBagConstraints5.gridy = 1;
376 			jLabel2 = new JLabel();
377 			jLabel2.setText("Server:");
378 			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
379 			gridBagConstraints4.fill = GridBagConstraints.BOTH;
380 			gridBagConstraints4.gridy = 2;
381 			gridBagConstraints4.weightx = 1.0;
382 			gridBagConstraints4.insets = new Insets(4, 4, 4, 0);
383 			gridBagConstraints4.gridx = -1;
384 			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
385 			gridBagConstraints3.gridx = -1;
386 			gridBagConstraints3.anchor = GridBagConstraints.EAST;
387 			gridBagConstraints3.gridy = 2;
388 			jPanel2 = new JPanel();
389 			jPanel2.setLayout(new GridBagLayout());
390 			jPanel2.add(jLabel1, gridBagConstraints3);
391 			jPanel2.add(getJTextFieldUserName(), gridBagConstraints4);
392 			jPanel2.add(jLabel2, gridBagConstraints5);
393 			jPanel2.add(jLabel3, gridBagConstraints7);
394 			jPanel2.add(getJPasswordField0(), gridBagConstraints8);
395 			jPanel2.add(getJPanelPasswordLabel(), gridBagConstraints10);
396 			jPanel2.add(getJPasswordField1(), gridBagConstraints12);
397 			jPanel2.add(getJPanelProfile(), gridBagConstraints16);
398 			jPanel2.add(jLabelProfile, gridBagConstraints17);
399 			jPanel2.add(getJPanelServerSelector(), gridBagConstraints6);
400 		}
401 		return jPanel2;
402 	}
403 
404 	/**
405 	 * This method initializes jTextFieldUserName	
406 	 * 	
407 	 * @return javax.swing.JTextField	
408 	 */
409 	private JTextField getJTextFieldUserName() {
410 		if (jTextFieldUserName == null) {
411 			jTextFieldUserName = new JTextField();
412 			jTextFieldUserName.addKeyListener(new java.awt.event.KeyAdapter() {
413 				public void keyTyped(java.awt.event.KeyEvent e) {
414 					userNameKeyTyped(e);
415 				}
416 			});
417 			jTextFieldUserName.addCaretListener(new javax.swing.event.CaretListener() {
418 				public void caretUpdate(javax.swing.event.CaretEvent e) {
419 					caretChanged(e);
420 				}
421 			});
422 		}
423 		return jTextFieldUserName;
424 	}
425 
426 	/**
427 	 * This method initializes jPasswordField0	
428 	 * 	
429 	 * @return javax.swing.JPasswordField	
430 	 */
431 	private JPasswordField getJPasswordField0() {
432 		if (jPasswordField0 == null) {
433 			jPasswordField0 = new JPasswordField();
434 			jPasswordField0.addKeyListener(new java.awt.event.KeyAdapter() {
435 				public void keyTyped(java.awt.event.KeyEvent e) {
436 					password0KeyTyped(e);
437 				}
438 			});
439 			jPasswordField0.addCaretListener(new javax.swing.event.CaretListener() {
440 				public void caretUpdate(javax.swing.event.CaretEvent e) {
441 					caretChanged(e);
442 				}
443 			});
444 		}
445 		return jPasswordField0;
446 	}
447 
448 	/**
449 	 * This method initializes jPanelPasswordLabel	
450 	 * 	
451 	 * @return javax.swing.JPanel	
452 	 */
453 	private JPanel getJPanelPasswordLabel() {
454 		if (jPanelPasswordLabel == null) {
455 			jLabel5 = new JLabel();
456 			jLabel5.setText("Password:");
457 			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
458 			gridBagConstraints9.gridx = 0;
459 			gridBagConstraints9.anchor = GridBagConstraints.EAST;
460 			gridBagConstraints9.gridy = 0;
461 			GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
462 			gridBagConstraints11.gridx = 0;
463 			gridBagConstraints11.anchor = GridBagConstraints.EAST;
464 			gridBagConstraints11.gridy = 1;
465 			jPanelPasswordLabel = new JPanel();
466 			jPanelPasswordLabel.setLayout(new GridBagLayout());
467 			jPanelPasswordLabel.add(jLabel4, gridBagConstraints9);
468 			jPanelPasswordLabel.add(jLabel5, gridBagConstraints11);
469 		}
470 		return jPanelPasswordLabel;
471 	}
472 
473 	/**
474 	 * This method initializes jPasswordField1	
475 	 * 	
476 	 * @return javax.swing.JPasswordField	
477 	 */
478 	private JPasswordField getJPasswordField1() {
479 		if (jPasswordField1 == null) {
480 			jPasswordField1 = new JPasswordField();
481 			jPasswordField1.addKeyListener(new java.awt.event.KeyAdapter() {
482 				public void keyTyped(java.awt.event.KeyEvent e) {
483 					password1KeyTyped(e);
484 				}
485 			});
486 			jPasswordField1.addCaretListener(new javax.swing.event.CaretListener() {
487 				public void caretUpdate(javax.swing.event.CaretEvent e) {
488 					caretChanged(e);
489 				}
490 			});
491 		}
492 		return jPasswordField1;
493 	}
494 
495 	/**
496 	 * This method initializes jButtonCreate	
497 	 * 	
498 	 * @return javax.swing.JButton	
499 	 */
500 	private JButton getJButtonCreate() {
501 		if (jButtonCreate == null) {
502 			jButtonCreate = new JButton();
503 			jButtonCreate.setText("Create Account");
504 			jButtonCreate.setEnabled(false);
505 			jButtonCreate.addActionListener(new java.awt.event.ActionListener() {
506 				public void actionPerformed(java.awt.event.ActionEvent e) {
507 					createNewAccountButtonActionPerformed(e);
508 				}
509 			});
510 		}
511 		return jButtonCreate;
512 	}
513 
514 	/**
515 	 * This method initializes jButtonCancel	
516 	 * 	
517 	 * @return javax.swing.JButton	
518 	 */
519 	private JButton getJButtonCancel() {
520 		if (jButtonCancel == null) {
521 			jButtonCancel = new JButton();
522 			jButtonCancel.setText("Cancel");
523 			jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
524 				public void actionPerformed(java.awt.event.ActionEvent e) {
525 					cancelButtonAction();
526 				}
527 			});
528 		}
529 		return jButtonCancel;
530 	}
531 
532 	/**
533 	 * This method initializes jButtonPanel	
534 	 * 	
535 	 * @return javax.swing.JPanel	
536 	 */
537 	private JPanel getJButtonPanel() {
538 		if (jButtonPanel == null) {
539 			GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
540 			gridBagConstraints13.gridx = -1;
541 			gridBagConstraints13.weightx = 0.5;
542 			gridBagConstraints13.gridy = -1;
543 			GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
544 			gridBagConstraints14.insets = new Insets(0, 0, 0, 0);
545 			gridBagConstraints14.gridy = -1;
546 			gridBagConstraints14.weightx = 0.5;
547 			gridBagConstraints14.gridx = -1;
548 			jButtonPanel = new JPanel();
549 			jButtonPanel.setLayout(new GridBagLayout());
550 			jButtonPanel.add(getJButtonCreate(), gridBagConstraints14);
551 			jButtonPanel.add(getJButtonCancel(), gridBagConstraints13);
552 		}
553 		return jButtonPanel;
554 	}
555 
556 	/**
557 	 * This method initializes jPanelStatus	
558 	 * 	
559 	 * @return javax.swing.JPanel	
560 	 */
561 	private JPanel getJPanelStatus() {
562 		if (jPanelStatus == null) {
563 			GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
564 			gridBagConstraints15.fill = GridBagConstraints.BOTH;
565 			gridBagConstraints15.gridy = -1;
566 			gridBagConstraints15.weightx = 1.0;
567 			gridBagConstraints15.weighty = 1.0;
568 			gridBagConstraints15.gridx = -1;
569 			jPanelStatus = new JPanel();
570 			jPanelStatus.setLayout(new GridBagLayout());
571 			jPanelStatus.setBorder(BorderFactory.createTitledBorder(null, "Status", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
572 			jPanelStatus.setVisible(false);
573 			jPanelStatus.add(getJTextAreaStatus(), gridBagConstraints15);
574 		}
575 		return jPanelStatus;
576 	}
577 
578 	/**
579 	 * This method initializes jTextAreaStatus	
580 	 * 	
581 	 * @return javax.swing.JTextArea	
582 	 */
583 	private JTextArea getJTextAreaStatus() {
584 		if (jTextAreaStatus == null) {
585 			jTextAreaStatus = new JTextArea();
586 			jTextAreaStatus.setLineWrap(true);
587 		}
588 		return jTextAreaStatus;
589 	}
590 
591 	/**
592 	 * This method initializes jPanelProfile	
593 	 * 	
594 	 * @return javax.swing.JPanel	
595 	 */
596 	private ProfileSelectorPanel getJPanelProfile() {
597 		if (jPanelProfile == null) {
598 			jPanelProfile = new ProfileSelectorPanel(this, this, properties);
599 			jPanelProfile.setLayout(new GridBagLayout());
600 		}
601 		return jPanelProfile;
602 	}
603 
604 	/**
605 	 * This method initializes jTextPaneStatus	
606 	 * 	
607 	 * @return javax.swing.JTextPane	
608 	 */
609 	private JTextPane getJTextPaneStatus() {
610 		if (jTextPaneStatus == null) {
611 			jTextPaneStatus = new JTextPane();
612 			jTextPaneStatus.setBackground(SystemColor.controlHighlight);
613 			jTextPaneStatus.setEditable(false);
614 		}
615 		return jTextPaneStatus;
616 	}
617 
618 	/**
619 	 * This method initializes jPanelServerSelector	
620 	 * 	
621 	 * @return javax.swing.JPanel	
622 	 */
623 	private ServerPortSelectorPanel getJPanelServerSelector() {
624 		if (jPanelServerSelector == null) {
625 			jPanelServerSelector = new ServerPortSelectorPanel(properties);
626 			jPanelServerSelector.setLayout(new GridBagLayout());
627 		}
628 		return jPanelServerSelector;
629 	}	
630 
631 	
632 }  //  @jve:decl-index=0:visual-constraint="10,10"