Source Code Cross Referenced for CheckBox.java in  » Web-Framework » ThinWire » thinwire » ui » 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 » ThinWire » thinwire.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        #IFNDEF ALT_LICENSE
003:                                   ThinWire(R) RIA Ajax Framework
004:                         Copyright (C) 2003-2007 Custom Credit Systems
005:
006:          This library is free software; you can redistribute it and/or modify it under
007:          the terms of the GNU Lesser General Public License as published by the Free
008:          Software Foundation; either version 2.1 of the License, or (at your option) any
009:          later version.
010:
011:          This library is distributed in the hope that it will be useful, but WITHOUT ANY
012:          WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
013:          PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
014:
015:          You should have received a copy of the GNU Lesser General Public License along
016:          with this library; if not, write to the Free Software Foundation, Inc., 59
017:          Temple Place, Suite 330, Boston, MA 02111-1307 USA
018:
019:          Users who would rather have a commercial license, warranty or support should
020:          contact the following company who invented, built and supports the technology:
021:          
022:                        Custom Credit Systems, Richardson, TX 75081, USA.
023:           	            email: info@thinwire.com    ph: +1 (888) 644-6405
024:         	                        http://www.thinwire.com
025:        #ENDIF
026:         [ v1.2_RC2 ] 
027:         */
028:        package thinwire.ui;
029:
030:        /**
031:         * A CheckBox is a screen element that can either be checked or cleared, and operates independently of other elements.
032:         * <p>
033:         * <b>Example:</b> <br>
034:         * <img src="doc-files/CheckBox-1.png"> <br>
035:         * 
036:         * <pre>
037:         * final CheckBox cb = new CheckBox(&quot;I am checked!&quot;);
038:         * cb.setChecked(true);
039:         * cb.setBounds(20, 20, 150, 30);
040:         * cb.addPropertyChangeListener(CheckBox.PROPERTY_CHECKED, new PropertyChangeListener() {
041:         *     public void propertyChange(PropertyChangeEvent pce) {
042:         *         if (pce.getNewValue() == Boolean.TRUE) {
043:         *             cb.setText(&quot;I am checked&quot;);
044:         *         } else {
045:         *             cb.setText(&quot;I am unchecked&quot;);
046:         *         }
047:         *     }
048:         * });
049:         * 
050:         * Dialog d = new Dialog(&quot;CheckBox Test&quot;);
051:         * d.setBounds(20, 20, 200, 100);
052:         * d.getChildren().add(cb);
053:         * d.setVisible(true);
054:         * </pre>
055:         * 
056:         * </p>
057:         * <p>
058:         * <b>Keyboard Navigation:</b><br>
059:         * <table border="1">
060:         * <tr>
061:         * <td>KEY</td>
062:         * <td>RESPONSE</td>
063:         * <td>NOTE</td>
064:         * </tr>
065:         * <tr>
066:         * <td>Space</td>
067:         * <td>Fires PropertyChangeEvent( propertyName = CheckBox.PROPERTY_CHECKED )</td>
068:         * <td>Only if the component has focus.</td>
069:         * </tr>
070:         * </table>
071:         * </p>
072:         * @author Joshua J. Gertzen
073:         */
074:        public class CheckBox extends AbstractTextComponent implements 
075:                CheckedComponent {
076:            public static final String PROPERTY_CHECKED = "checked";
077:
078:            private boolean checked;
079:
080:            /**
081:             * Constructs a new CheckBox with no text.
082:             */
083:            public CheckBox() {
084:                this (null);
085:            }
086:
087:            /**
088:             * Constructs a new CheckBox with the specified text.
089:             * @param text the text to display on the right side of the CheckBox.
090:             */
091:            public CheckBox(String text) {
092:                this (text, false);
093:            }
094:
095:            /**
096:             * Constructs a new CheckBox with the specified text and initial checked state.
097:             * @param text the text to display on the right side of the CheckBox.
098:             * @param checked the initial checked state
099:             */
100:            public CheckBox(String text, boolean checked) {
101:                setText(text);
102:                setChecked(checked);
103:            }
104:
105:            public boolean isChecked() {
106:                return checked;
107:            }
108:
109:            public void setChecked(boolean checked) {
110:                boolean oldChecked = this.checked;
111:                this.checked = checked;
112:                firePropertyChange(this, PROPERTY_CHECKED, oldChecked, checked);
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.