Source Code Cross Referenced for Test2.java in  » Web-Framework » webonswing » net » ar » webonswing » tutorial » 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 » Web Framework » webonswing » net.ar.webonswing.tutorial 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.ar.webonswing.tutorial;
002:
003:        import javax.swing.*;
004:
005:        import net.ar.webonswing.swing.components.validators.*;
006:
007:        public class Test2 extends JFrame {
008:
009:            private javax.swing.JPanel jContentPane = null;
010:
011:            private javax.swing.JTextField jTextField = null;
012:            private javax.swing.JLabel jLabel = null;
013:            private javax.swing.JTextField jTextField1 = null;
014:            private javax.swing.JLabel jLabel1 = null;
015:            private JValidator validator1 = null;
016:            private JCompareValidator validator2 = null;
017:            private javax.swing.JButton jButton = null;
018:            private JGroupValidator pageValidator = null;
019:            private javax.swing.JLabel jLabel2 = null;
020:            private net.ar.webonswing.swing.components.validators.JRequiredFieldValidator jRequiredFieldValidator = null;
021:
022:            /**
023:             * This is the default constructor
024:             */
025:            public Test2() {
026:                super ();
027:                initialize();
028:            }
029:
030:            /**
031:             * This method initializes this
032:             * 
033:             * @return void
034:             */
035:            private void initialize() {
036:                this .setSize(371, 292);
037:                this .setContentPane(getJContentPane());
038:            }
039:
040:            /**
041:             * This method initializes jContentPane
042:             * 
043:             * @return javax.swing.JPanel
044:             */
045:            private javax.swing.JPanel getJContentPane() {
046:                if (jContentPane == null) {
047:                    jContentPane = new javax.swing.JPanel();
048:                    jContentPane.setLayout(null);
049:                    jContentPane.add(getJTextField(), null);
050:                    jContentPane.add(getJLabel(), null);
051:                    jContentPane.add(getJTextField1(), null);
052:                    jContentPane.add(getJLabel1(), null);
053:                    jContentPane.add(getValidator1(), null);
054:                    jContentPane.add(getValidator2(), null);
055:                    jContentPane.add(getJButton(), null);
056:                    jContentPane.add(getPageValidator(), null);
057:                    jContentPane.add(getJLabel2(), null);
058:                    jContentPane.add(getJRequiredFieldValidator(), null);
059:                }
060:                return jContentPane;
061:            }
062:
063:            /**
064:             * This method initializes jTextField
065:             * 
066:             * @return javax.swing.JTextField
067:             */
068:            private javax.swing.JTextField getJTextField() {
069:                if (jTextField == null) {
070:                    jTextField = new javax.swing.JTextField();
071:                    jTextField.setBounds(100, 20, 125, 29);
072:                }
073:                return jTextField;
074:            }
075:
076:            /**
077:             * This method initializes jLabel
078:             * 
079:             * @return javax.swing.JLabel
080:             */
081:            private javax.swing.JLabel getJLabel() {
082:                if (jLabel == null) {
083:                    jLabel = new javax.swing.JLabel();
084:                    jLabel.setBounds(20, 20, 66, 29);
085:                    jLabel.setText("JLabel");
086:                }
087:                return jLabel;
088:            }
089:
090:            /**
091:             * This method initializes jTextField1
092:             * 
093:             * @return javax.swing.JTextField
094:             */
095:            private javax.swing.JTextField getJTextField1() {
096:                if (jTextField1 == null) {
097:                    jTextField1 = new javax.swing.JTextField();
098:                    jTextField1.setBounds(100, 60, 122, 29);
099:                }
100:                return jTextField1;
101:            }
102:
103:            /**
104:             * This method initializes jLabel1
105:             * 
106:             * @return javax.swing.JLabel
107:             */
108:            private javax.swing.JLabel getJLabel1() {
109:                if (jLabel1 == null) {
110:                    jLabel1 = new javax.swing.JLabel();
111:                    jLabel1.setBounds(20, 60, 66, 29);
112:                    jLabel1.setText("JLabel");
113:                }
114:                return jLabel1;
115:            }
116:
117:            /**
118:             * This method initializes validator1
119:             * 
120:             * @return javax.swing.JLabel
121:             */
122:            private JValidator getValidator1() {
123:                if (validator1 == null) {
124:                    validator1 = new JRequiredFieldValidator();
125:                    validator1.setComponentToValidate(getJTextField());
126:                    validator1.setBounds(240, 20, 86, 28);
127:                    validator1.setText("");
128:                    validator1.setRemoteValidation(true);
129:                }
130:                return validator1;
131:            }
132:
133:            /**
134:             * This method initializes validator2
135:             * 
136:             * @return javax.swing.JLabel
137:             */
138:            private JValidator getValidator2() {
139:                if (validator2 == null) {
140:                    validator2 = new JCompareValidator();
141:                    validator2.setComponentToValidate(getJTextField1());
142:                    validator2.setBounds(240, 60, 87, 29);
143:                    validator2.setText("");
144:                    validator2.setOwnMessage("*");
145:                    validator2.setGroupMessage("Must be greater than 4");
146:                    validator2.setType(JCompareValidator.Type.INTEGER);
147:                    validator2
148:                            .setOperation(JCompareValidator.Operation.greaterThan);
149:                    validator2.setValueToCompare("4");
150:                    validator2.setRemoteValidation(true);
151:                }
152:                return validator2;
153:            }
154:
155:            /**
156:             * This method initializes jButton
157:             * 
158:             * @return javax.swing.JButton
159:             */
160:            private javax.swing.JButton getJButton() {
161:                if (jButton == null) {
162:                    jButton = new javax.swing.JButton();
163:                    jButton.setBounds(20, 220, 141, 41);
164:                    jButton.setText("Save");
165:                    jButton
166:                            .addActionListener(new java.awt.event.ActionListener() {
167:                                public void actionPerformed(
168:                                        java.awt.event.ActionEvent e) {
169:                                    if (pageValidator.doValidation())
170:                                        getJLabel2()
171:                                                .setText(
172:                                                        "Congratulations, everything is valid!!!");
173:                                    else
174:                                        getJLabel2().setText("ERROR!!!");
175:                                }
176:                            });
177:                }
178:                return jButton;
179:            }
180:
181:            /**
182:             * This method initializes pageValidator
183:             * 
184:             * @return javax.swing.JLabel
185:             */
186:            private JValidator getPageValidator() {
187:                if (pageValidator == null) {
188:                    pageValidator = new JGroupValidator(
189:                            "Please fix this errors", true);
190:                    pageValidator.setBounds(20, 140, 305, 71);
191:                    pageValidator.setText("JLabel");
192:                    pageValidator.addValidator(getValidator1());
193:                    pageValidator.addValidator(getValidator2());
194:                }
195:                return pageValidator;
196:            }
197:
198:            /**
199:             * This method initializes jLabel2
200:             * 
201:             * @return javax.swing.JLabel
202:             */
203:            private javax.swing.JLabel getJLabel2() {
204:                if (jLabel2 == null) {
205:                    jLabel2 = new javax.swing.JLabel();
206:                    jLabel2.setBounds(20, 100, 307, 25);
207:                    jLabel2.setText("JLabel");
208:                }
209:                return jLabel2;
210:            }
211:
212:            public static void main(String[] args) {
213:                Test2 test2 = new Test2();
214:                test2.setVisible(true);
215:            }
216:
217:            /**
218:             * This method initializes jRequiredFieldValidator
219:             * 
220:             * @return net.ar.webonswing.swing.components.validators.JRequiredFieldValidator
221:             */
222:            private net.ar.webonswing.swing.components.validators.JRequiredFieldValidator getJRequiredFieldValidator() {
223:                if (jRequiredFieldValidator == null) {
224:                    jRequiredFieldValidator = new net.ar.webonswing.swing.components.validators.JRequiredFieldValidator();
225:                    jRequiredFieldValidator.setBounds(191, 224, 148, 28);
226:                    jRequiredFieldValidator.setText("JLabel");
227:                }
228:                return jRequiredFieldValidator;
229:            }
230:        } //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.