Source Code Cross Referenced for ClientEditor.java in  » IDE-Netbeans » java » ClientEditor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » java » ClientEditor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2007, Sun Microsystems, Inc.
003:         * All rights reserved.
004:         * 
005:         * Redistribution and use in source and binary forms, with or without 
006:         * modification, are permitted provided that the following conditions are met:
007:         * 
008:         *  * Redistributions of source code must retain the above copyright notice, 
009:         *    this list of conditions and the following disclaimer.
010:         *  * Redistributions in binary form must reproduce the above copyright 
011:         *    notice, this list of conditions and the following disclaimer in 
012:         *    the documentation and/or other materials provided with the distribution.
013:         *  * Neither the name of Sun Microsystems, Inc. nor the names of its 
014:         *    contributors may be used to endorse or promote products derived 
015:         *    from this software without specific prior written permission.
016:         *
017:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
018:         * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
019:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
020:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
021:         * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
022:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
023:         * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
024:         * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
025:         * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
026:         * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028:         */
029:
030:        package clienteditor;
031:
032:        import java.beans.PropertyChangeListener;
033:        import java.beans.PropertyChangeSupport;
034:
035:        /**
036:         * Form that allows editing of information about one client.
037:         *
038:         * @author Jiri Vagner, Jan Stola
039:         */
040:        public class ClientEditor extends javax.swing.JPanel {
041:            private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
042:                    this );
043:            private Client client = Client.createTestClient();
044:
045:            public ClientEditor() {
046:                initComponents();
047:                bindingGroup.addBindingListener(new LoggingBindingListener(
048:                        validationMsgLabel));
049:            }
050:
051:            /**
052:             * Returns <code>Client</code> being edited.
053:             * 
054:             * @return <code>Client</code> being edited.
055:             */
056:            public Client getClient() {
057:                return client;
058:            }
059:
060:            /** 
061:             * Sets client to edit.
062:             * 
063:             * @param client client to edit.
064:             */
065:            public void setClient(Client client) {
066:                Client oldClient = this .client;
067:                this .client = client;
068:                changeSupport.firePropertyChange("client", oldClient, client);
069:            }
070:
071:            @Override
072:            public void addPropertyChangeListener(
073:                    PropertyChangeListener listener) {
074:                super .addPropertyChangeListener(listener);
075:                changeSupport.addPropertyChangeListener(listener);
076:            }
077:
078:            @Override
079:            public synchronized void removePropertyChangeListener(
080:                    PropertyChangeListener listener) {
081:                super .removePropertyChangeListener(listener);
082:                changeSupport.removePropertyChangeListener(listener);
083:            }
084:
085:            /** This method is called from within the constructor to
086:             * initialize the form.
087:             * WARNING: Do NOT modify this code. The content of this method is
088:             * always regenerated by the Form Editor.
089:             */
090:            // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
091:            private void initComponents() {
092:                bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
093:
094:                sexButtonGroup = new javax.swing.ButtonGroup();
095:                ageConverter = new clienteditor.AgeConverter();
096:                ageValidator = new clienteditor.AgeValidator();
097:                maritalStatusConverter = new clienteditor.MaritalStatusConverter();
098:                requiredStringValidator = new clienteditor.RequiredStringValidator();
099:                emailValidator = new clienteditor.EmailValidator();
100:                clientInfoPane = new javax.swing.JTabbedPane();
101:                personalPanel = new javax.swing.JPanel();
102:                firstNameLabel = new javax.swing.JLabel();
103:                firstNameTextField = new javax.swing.JTextField();
104:                surnameLabel = new javax.swing.JLabel();
105:                surnameTextField = new javax.swing.JTextField();
106:                maritalComboBox = new javax.swing.JComboBox();
107:                sexLabel = new javax.swing.JLabel();
108:                maritalStatusLabel = new javax.swing.JLabel();
109:                maleRadioButton = new javax.swing.JRadioButton();
110:                femaleRadioButton = new javax.swing.JRadioButton();
111:                ageLabel = new javax.swing.JLabel();
112:                ageTextField = new javax.swing.JTextField();
113:                contactPanel = new javax.swing.JPanel();
114:                nicknameLabel = new javax.swing.JLabel();
115:                emailLabel = new javax.swing.JLabel();
116:                webLabel = new javax.swing.JLabel();
117:                imLabel = new javax.swing.JLabel();
118:                nicknameTextField = new javax.swing.JTextField();
119:                emailTextField = new javax.swing.JTextField();
120:                webTextField = new javax.swing.JTextField();
121:                imTextField = new javax.swing.JTextField();
122:                usernameLabel = new javax.swing.JLabel();
123:                clientInfoLabel = new javax.swing.JLabel();
124:                validationMsgLabel = new javax.swing.JLabel();
125:
126:                personalPanel.setBorder(javax.swing.BorderFactory
127:                        .createEtchedBorder());
128:
129:                firstNameLabel.setText("First Name:"); // NOI18N
130:
131:                org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings
132:                        .createAutoBinding(
133:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
134:                                this , org.jdesktop.beansbinding.ELProperty
135:                                        .create("${client.firstName}"),
136:                                firstNameTextField,
137:                                org.jdesktop.beansbinding.BeanProperty
138:                                        .create("text"), "firstName"); // NOI18N
139:                bindingGroup.addBinding(binding);
140:
141:                surnameLabel.setText("Surname:"); // NOI18N
142:
143:                binding = org.jdesktop.beansbinding.Bindings
144:                        .createAutoBinding(
145:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
146:                                this , org.jdesktop.beansbinding.ELProperty
147:                                        .create("${client.surname}"),
148:                                surnameTextField,
149:                                org.jdesktop.beansbinding.BeanProperty
150:                                        .create("text"), "surname"); // NOI18N
151:                binding.setValidator(requiredStringValidator);
152:                bindingGroup.addBinding(binding);
153:
154:                maritalComboBox.setModel(new javax.swing.DefaultComboBoxModel(
155:                        new String[] { "Single", "Married", "Separated",
156:                                "Divorced" }));
157:
158:                binding = org.jdesktop.beansbinding.Bindings
159:                        .createAutoBinding(
160:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
161:                                this , org.jdesktop.beansbinding.ELProperty
162:                                        .create("${client.maritalStatus}"),
163:                                maritalComboBox,
164:                                org.jdesktop.beansbinding.BeanProperty
165:                                        .create("selectedItem"),
166:                                "maritalStatus"); // NOI18N
167:                binding.setConverter(maritalStatusConverter);
168:                bindingGroup.addBinding(binding);
169:
170:                sexLabel.setText("Sex:"); // NOI18N
171:
172:                maritalStatusLabel.setText("Marital status:"); // NOI18N
173:
174:                sexButtonGroup.add(maleRadioButton);
175:                maleRadioButton.setText("male"); // NOI18N
176:
177:                binding = org.jdesktop.beansbinding.Bindings
178:                        .createAutoBinding(
179:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
180:                                this , org.jdesktop.beansbinding.ELProperty
181:                                        .create("${client.sex}"),
182:                                maleRadioButton,
183:                                org.jdesktop.beansbinding.BeanProperty
184:                                        .create("selected"), "sex"); // NOI18N
185:                bindingGroup.addBinding(binding);
186:
187:                sexButtonGroup.add(femaleRadioButton);
188:                femaleRadioButton.setText("female"); // NOI18N
189:
190:                ageLabel.setText("Age:"); // NOI18N
191:
192:                binding = org.jdesktop.beansbinding.Bindings
193:                        .createAutoBinding(
194:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
195:                                this , org.jdesktop.beansbinding.ELProperty
196:                                        .create("${client.age}"), ageTextField,
197:                                org.jdesktop.beansbinding.BeanProperty
198:                                        .create("text"), "age");
199:                binding.setConverter(ageConverter);
200:                binding.setValidator(ageValidator);
201:                bindingGroup.addBinding(binding);
202:
203:                org.jdesktop.layout.GroupLayout personalPanelLayout = new org.jdesktop.layout.GroupLayout(
204:                        personalPanel);
205:                personalPanel.setLayout(personalPanelLayout);
206:                personalPanelLayout
207:                        .setHorizontalGroup(personalPanelLayout
208:                                .createParallelGroup(
209:                                        org.jdesktop.layout.GroupLayout.LEADING)
210:                                .add(
211:                                        personalPanelLayout
212:                                                .createSequentialGroup()
213:                                                .addContainerGap()
214:                                                .add(
215:                                                        personalPanelLayout
216:                                                                .createParallelGroup(
217:                                                                        org.jdesktop.layout.GroupLayout.LEADING)
218:                                                                .add(sexLabel)
219:                                                                .add(
220:                                                                        personalPanelLayout
221:                                                                                .createSequentialGroup()
222:                                                                                .add(
223:                                                                                        personalPanelLayout
224:                                                                                                .createParallelGroup(
225:                                                                                                        org.jdesktop.layout.GroupLayout.LEADING)
226:                                                                                                .add(
227:                                                                                                        firstNameLabel)
228:                                                                                                .add(
229:                                                                                                        surnameLabel)
230:                                                                                                .add(
231:                                                                                                        maritalStatusLabel)
232:                                                                                                .add(
233:                                                                                                        ageLabel))
234:                                                                                .add(
235:                                                                                        7,
236:                                                                                        7,
237:                                                                                        7)
238:                                                                                .add(
239:                                                                                        personalPanelLayout
240:                                                                                                .createParallelGroup(
241:                                                                                                        org.jdesktop.layout.GroupLayout.LEADING)
242:                                                                                                .add(
243:                                                                                                        personalPanelLayout
244:                                                                                                                .createSequentialGroup()
245:                                                                                                                .add(
246:                                                                                                                        maleRadioButton)
247:                                                                                                                .addPreferredGap(
248:                                                                                                                        org.jdesktop.layout.LayoutStyle.RELATED)
249:                                                                                                                .add(
250:                                                                                                                        femaleRadioButton))
251:                                                                                                .add(
252:                                                                                                        firstNameTextField,
253:                                                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
254:                                                                                                        265,
255:                                                                                                        Short.MAX_VALUE)
256:                                                                                                .add(
257:                                                                                                        surnameTextField,
258:                                                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
259:                                                                                                        265,
260:                                                                                                        Short.MAX_VALUE)
261:                                                                                                .add(
262:                                                                                                        personalPanelLayout
263:                                                                                                                .createParallelGroup(
264:                                                                                                                        org.jdesktop.layout.GroupLayout.TRAILING,
265:                                                                                                                        false)
266:                                                                                                                .add(
267:                                                                                                                        org.jdesktop.layout.GroupLayout.LEADING,
268:                                                                                                                        ageTextField)
269:                                                                                                                .add(
270:                                                                                                                        org.jdesktop.layout.GroupLayout.LEADING,
271:                                                                                                                        maritalComboBox,
272:                                                                                                                        0,
273:                                                                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
274:                                                                                                                        Short.MAX_VALUE)))))
275:                                                .addContainerGap()));
276:                personalPanelLayout
277:                        .setVerticalGroup(personalPanelLayout
278:                                .createParallelGroup(
279:                                        org.jdesktop.layout.GroupLayout.LEADING)
280:                                .add(
281:                                        personalPanelLayout
282:                                                .createSequentialGroup()
283:                                                .addContainerGap()
284:                                                .add(
285:                                                        personalPanelLayout
286:                                                                .createParallelGroup(
287:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
288:                                                                .add(
289:                                                                        firstNameLabel)
290:                                                                .add(
291:                                                                        firstNameTextField,
292:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
293:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
294:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
295:                                                .addPreferredGap(
296:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
297:                                                .add(
298:                                                        personalPanelLayout
299:                                                                .createParallelGroup(
300:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
301:                                                                .add(
302:                                                                        surnameLabel)
303:                                                                .add(
304:                                                                        surnameTextField,
305:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
306:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
307:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
308:                                                .addPreferredGap(
309:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
310:                                                .add(
311:                                                        personalPanelLayout
312:                                                                .createParallelGroup(
313:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
314:                                                                .add(
315:                                                                        maritalStatusLabel)
316:                                                                .add(
317:                                                                        maritalComboBox,
318:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
319:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
320:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
321:                                                .addPreferredGap(
322:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
323:                                                .add(
324:                                                        personalPanelLayout
325:                                                                .createParallelGroup(
326:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
327:                                                                .add(ageLabel)
328:                                                                .add(
329:                                                                        ageTextField,
330:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
331:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
332:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
333:                                                .addPreferredGap(
334:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
335:                                                .add(
336:                                                        personalPanelLayout
337:                                                                .createParallelGroup(
338:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
339:                                                                .add(sexLabel)
340:                                                                .add(
341:                                                                        femaleRadioButton)
342:                                                                .add(
343:                                                                        maleRadioButton))
344:                                                .addContainerGap(
345:                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
346:                                                        Short.MAX_VALUE)));
347:
348:                clientInfoPane.addTab("Personal", personalPanel);
349:
350:                contactPanel.setBorder(javax.swing.BorderFactory
351:                        .createEtchedBorder());
352:
353:                nicknameLabel.setText("Nickname:"); // NOI18N
354:
355:                emailLabel.setText("E-mail:"); // NOI18N
356:
357:                webLabel.setText("Web:"); // NOI18N
358:
359:                imLabel.setText("IM:"); // NOI18N
360:
361:                binding = org.jdesktop.beansbinding.Bindings
362:                        .createAutoBinding(
363:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
364:                                this , org.jdesktop.beansbinding.ELProperty
365:                                        .create("${client.nickname}"),
366:                                nicknameTextField,
367:                                org.jdesktop.beansbinding.BeanProperty
368:                                        .create("text"), "nickname"); // NOI18N
369:                bindingGroup.addBinding(binding);
370:
371:                binding = org.jdesktop.beansbinding.Bindings
372:                        .createAutoBinding(
373:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
374:                                this , org.jdesktop.beansbinding.ELProperty
375:                                        .create("${client.email}"),
376:                                emailTextField,
377:                                org.jdesktop.beansbinding.BeanProperty
378:                                        .create("text"), "email");
379:                binding.setValidator(emailValidator);
380:                bindingGroup.addBinding(binding);
381:
382:                binding = org.jdesktop.beansbinding.Bindings
383:                        .createAutoBinding(
384:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
385:                                this , org.jdesktop.beansbinding.ELProperty
386:                                        .create("${client.web}"), webTextField,
387:                                org.jdesktop.beansbinding.BeanProperty
388:                                        .create("text"), "web");
389:                bindingGroup.addBinding(binding);
390:
391:                binding = org.jdesktop.beansbinding.Bindings
392:                        .createAutoBinding(
393:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
394:                                this , org.jdesktop.beansbinding.ELProperty
395:                                        .create("${client.im}"), imTextField,
396:                                org.jdesktop.beansbinding.BeanProperty
397:                                        .create("text"), "im");
398:                bindingGroup.addBinding(binding);
399:
400:                org.jdesktop.layout.GroupLayout contactPanelLayout = new org.jdesktop.layout.GroupLayout(
401:                        contactPanel);
402:                contactPanel.setLayout(contactPanelLayout);
403:                contactPanelLayout
404:                        .setHorizontalGroup(contactPanelLayout
405:                                .createParallelGroup(
406:                                        org.jdesktop.layout.GroupLayout.LEADING)
407:                                .add(
408:                                        contactPanelLayout
409:                                                .createSequentialGroup()
410:                                                .addContainerGap()
411:                                                .add(
412:                                                        contactPanelLayout
413:                                                                .createParallelGroup(
414:                                                                        org.jdesktop.layout.GroupLayout.LEADING)
415:                                                                .add(
416:                                                                        nicknameLabel)
417:                                                                .add(emailLabel)
418:                                                                .add(webLabel)
419:                                                                .add(imLabel))
420:                                                .addPreferredGap(
421:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
422:                                                .add(
423:                                                        contactPanelLayout
424:                                                                .createParallelGroup(
425:                                                                        org.jdesktop.layout.GroupLayout.LEADING)
426:                                                                .add(
427:                                                                        nicknameTextField,
428:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
429:                                                                        288,
430:                                                                        Short.MAX_VALUE)
431:                                                                .add(
432:                                                                        emailTextField,
433:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
434:                                                                        288,
435:                                                                        Short.MAX_VALUE)
436:                                                                .add(
437:                                                                        webTextField,
438:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
439:                                                                        288,
440:                                                                        Short.MAX_VALUE)
441:                                                                .add(
442:                                                                        imTextField,
443:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
444:                                                                        288,
445:                                                                        Short.MAX_VALUE))
446:                                                .addContainerGap()));
447:                contactPanelLayout
448:                        .setVerticalGroup(contactPanelLayout
449:                                .createParallelGroup(
450:                                        org.jdesktop.layout.GroupLayout.LEADING)
451:                                .add(
452:                                        contactPanelLayout
453:                                                .createSequentialGroup()
454:                                                .addContainerGap()
455:                                                .add(
456:                                                        contactPanelLayout
457:                                                                .createParallelGroup(
458:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
459:                                                                .add(
460:                                                                        nicknameLabel)
461:                                                                .add(
462:                                                                        nicknameTextField,
463:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
464:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
465:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
466:                                                .addPreferredGap(
467:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
468:                                                .add(
469:                                                        contactPanelLayout
470:                                                                .createParallelGroup(
471:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
472:                                                                .add(emailLabel)
473:                                                                .add(
474:                                                                        emailTextField,
475:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
476:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
477:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
478:                                                .addPreferredGap(
479:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
480:                                                .add(
481:                                                        contactPanelLayout
482:                                                                .createParallelGroup(
483:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
484:                                                                .add(webLabel)
485:                                                                .add(
486:                                                                        webTextField,
487:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
488:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
489:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
490:                                                .addPreferredGap(
491:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
492:                                                .add(
493:                                                        contactPanelLayout
494:                                                                .createParallelGroup(
495:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
496:                                                                .add(imLabel)
497:                                                                .add(
498:                                                                        imTextField,
499:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
500:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
501:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
502:                                                .addContainerGap(34,
503:                                                        Short.MAX_VALUE)));
504:
505:                clientInfoPane.addTab("Contact", contactPanel);
506:
507:                usernameLabel.setFont(new java.awt.Font("Dialog", 1, 24));
508:
509:                binding = org.jdesktop.beansbinding.Bindings
510:                        .createAutoBinding(
511:                                org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
512:                                this ,
513:                                org.jdesktop.beansbinding.ELProperty
514:                                        .create("${client.firstName} ${client.surname}"),
515:                                usernameLabel,
516:                                org.jdesktop.beansbinding.BeanProperty
517:                                        .create("text"), "displayNameTitle");
518:                bindingGroup.addBinding(binding);
519:
520:                clientInfoLabel.setFont(new java.awt.Font("Dialog", 0, 24));
521:                clientInfoLabel.setText("Client Info:"); // NOI18N
522:
523:                validationMsgLabel.setFont(new java.awt.Font("Dialog", 1, 11));
524:                validationMsgLabel.setForeground(new java.awt.Color(255, 0, 0));
525:
526:                org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
527:                        this );
528:                this .setLayout(layout);
529:                layout
530:                        .setHorizontalGroup(layout
531:                                .createParallelGroup(
532:                                        org.jdesktop.layout.GroupLayout.LEADING)
533:                                .add(
534:                                        org.jdesktop.layout.GroupLayout.TRAILING,
535:                                        layout
536:                                                .createSequentialGroup()
537:                                                .addContainerGap()
538:                                                .add(
539:                                                        layout
540:                                                                .createParallelGroup(
541:                                                                        org.jdesktop.layout.GroupLayout.TRAILING)
542:                                                                .add(
543:                                                                        org.jdesktop.layout.GroupLayout.LEADING,
544:                                                                        clientInfoPane,
545:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
546:                                                                        370,
547:                                                                        Short.MAX_VALUE)
548:                                                                .add(
549:                                                                        org.jdesktop.layout.GroupLayout.LEADING,
550:                                                                        layout
551:                                                                                .createSequentialGroup()
552:                                                                                .add(
553:                                                                                        clientInfoLabel)
554:                                                                                .addPreferredGap(
555:                                                                                        org.jdesktop.layout.LayoutStyle.RELATED)
556:                                                                                .add(
557:                                                                                        usernameLabel,
558:                                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
559:                                                                                        248,
560:                                                                                        Short.MAX_VALUE))
561:                                                                .add(
562:                                                                        org.jdesktop.layout.GroupLayout.LEADING,
563:                                                                        validationMsgLabel,
564:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
565:                                                                        370,
566:                                                                        Short.MAX_VALUE))
567:                                                .addContainerGap()));
568:                layout
569:                        .setVerticalGroup(layout
570:                                .createParallelGroup(
571:                                        org.jdesktop.layout.GroupLayout.LEADING)
572:                                .add(
573:                                        layout
574:                                                .createSequentialGroup()
575:                                                .addContainerGap()
576:                                                .add(
577:                                                        layout
578:                                                                .createParallelGroup(
579:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
580:                                                                .add(
581:                                                                        clientInfoLabel,
582:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
583:                                                                        27,
584:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
585:                                                                .add(
586:                                                                        usernameLabel,
587:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
588:                                                                        27,
589:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
590:                                                .addPreferredGap(
591:                                                        org.jdesktop.layout.LayoutStyle.UNRELATED)
592:                                                .add(clientInfoPane)
593:                                                .add(5, 5, 5)
594:                                                .add(
595:                                                        validationMsgLabel,
596:                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
597:                                                        18,
598:                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
599:                                                .addContainerGap()));
600:
601:                bindingGroup.bind();
602:            }// </editor-fold>//GEN-END:initComponents
603:
604:            /**
605:             * @param args the command line arguments
606:             */
607:            public static void main(String args[]) {
608:                java.awt.EventQueue.invokeLater(new Runnable() {
609:                    public void run() {
610:                        javax.swing.JFrame frame = new javax.swing.JFrame(
611:                                "Client Editor");
612:                        frame
613:                                .setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
614:                        frame.getContentPane().add(new ClientEditor());
615:                        frame.pack();
616:                        frame.setVisible(true);
617:                    }
618:                });
619:            }
620:
621:            // Variables declaration - do not modify//GEN-BEGIN:variables
622:            private clienteditor.AgeConverter ageConverter;
623:            private javax.swing.JLabel ageLabel;
624:            private javax.swing.JTextField ageTextField;
625:            private clienteditor.AgeValidator ageValidator;
626:            private javax.swing.JLabel clientInfoLabel;
627:            private javax.swing.JTabbedPane clientInfoPane;
628:            private javax.swing.JPanel contactPanel;
629:            private javax.swing.JLabel emailLabel;
630:            private javax.swing.JTextField emailTextField;
631:            private clienteditor.EmailValidator emailValidator;
632:            private javax.swing.JRadioButton femaleRadioButton;
633:            private javax.swing.JLabel firstNameLabel;
634:            private javax.swing.JTextField firstNameTextField;
635:            private javax.swing.JLabel imLabel;
636:            private javax.swing.JTextField imTextField;
637:            private javax.swing.JRadioButton maleRadioButton;
638:            private javax.swing.JComboBox maritalComboBox;
639:            private clienteditor.MaritalStatusConverter maritalStatusConverter;
640:            private javax.swing.JLabel maritalStatusLabel;
641:            private javax.swing.JLabel nicknameLabel;
642:            private javax.swing.JTextField nicknameTextField;
643:            private javax.swing.JPanel personalPanel;
644:            private clienteditor.RequiredStringValidator requiredStringValidator;
645:            private javax.swing.ButtonGroup sexButtonGroup;
646:            private javax.swing.JLabel sexLabel;
647:            private javax.swing.JLabel surnameLabel;
648:            private javax.swing.JTextField surnameTextField;
649:            private javax.swing.JLabel usernameLabel;
650:            private javax.swing.JLabel validationMsgLabel;
651:            private javax.swing.JLabel webLabel;
652:            private javax.swing.JTextField webTextField;
653:            private org.jdesktop.beansbinding.BindingGroup bindingGroup;
654:            // End of variables declaration//GEN-END:variables
655:
656:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.