Source Code Cross Referenced for TextFieldPanel.java in  » Web-Framework » wingS » com » javujavu » javux » demo » 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 » wingS » com.javujavu.javux.demo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *	Javu WingS - Lightweight Java Component Set
003:         *	Copyright (c) 2005-2007 Krzysztof A. Sadlocha
004:         *	e-mail: ksadlocha@programics.com
005:         *
006:         *	This library is free software; you can redistribute it and/or
007:         *	modify it under the terms of the GNU Lesser General Public
008:         *	License as published by the Free Software Foundation; either
009:         *	version 2.1 of the License, or (at your option) any later version.
010:         *
011:         *	This library is distributed in the hope that it will be useful,
012:         *	but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *	Lesser General Public License for more details.
015:         *
016:         *	You should have received a copy of the GNU Lesser General Public
017:         *	License along with this library; if not, write to the Free Software
018:         *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         */
020:
021:        package com.javujavu.javux.demo;
022:
023:        import java.awt.BorderLayout;
024:        import java.awt.GridBagConstraints;
025:        import java.awt.GridBagLayout;
026:        import java.awt.Insets;
027:        import com.javujavu.javux.wings.WingButton;
028:        import com.javujavu.javux.wings.WingLabel;
029:        import com.javujavu.javux.wings.WingPanel;
030:        import com.javujavu.javux.wings.WingTextField;
031:        import com.javujavu.javux.wings.item.LabelItem;
032:
033:        public class TextFieldPanel extends WingPanel {
034:            public TextFieldPanel(WingSetPanel owner) {
035:                this .setLayout(new GridBagLayout());
036:                WingPanel panelAll, panel;
037:                panelAll = new WingPanel(new BorderLayout());
038:                panelAll.add(panel = new WingPanel(new GridBagLayout()),
039:                        BorderLayout.CENTER);
040:                GridBagConstraints c = new GridBagConstraints();
041:                c.insets = new Insets(10, 10, 10, 10);
042:                c.anchor = GridBagConstraints.CENTER;
043:                c.fill = GridBagConstraints.BOTH;
044:                c.weightx = 1.0;
045:                c.weighty = 1.0;
046:                this .add(panelAll, c);
047:
048:                String keys = "\n\nKeys:\nCtrl+A - select All\nCtrl+Insert,Ctrl+C - copy selection to clipboard\nShift+Insert,Ctrl+V - paste\nShift+Delete,Ctrl+X - cut";
049:
050:                c = new GridBagConstraints();
051:                c.insets = new Insets(8, 5, 8, 5);
052:                c.weighty = 1.0;
053:                c.gridwidth = 1;
054:                c.anchor = GridBagConstraints.EAST;
055:                panel.add(new WingLabel("TextField"), c);
056:                c.anchor = GridBagConstraints.WEST;
057:                c.gridwidth = GridBagConstraints.REMAINDER;
058:                WingTextField tf;
059:                panel.add(tf = new WingTextField("text field", 20), c);
060:                tf.addTextListener(owner.eventTracer);
061:                tf.setTooltip(new LabelItem("WingTextField\ndefault style"
062:                        + keys, WingSet.imgEye, LEFT, LEFT));
063:
064:                c.gridwidth = 1;
065:                c.anchor = GridBagConstraints.EAST;
066:                panel.add(new WingLabel("right alignment"), c);
067:                c.anchor = GridBagConstraints.WEST;
068:                c.gridwidth = GridBagConstraints.REMAINDER;
069:                panel.add(tf = new WingTextField("right alignment", 20), c);
070:                tf.setHorizontalAlignment(RIGHT);
071:                tf.addTextListener(owner.eventTracer);
072:                tf.setTooltip(new LabelItem(
073:                        "WingTextField\nalignment RIGHT\ndefault style" + keys,
074:                        WingSet.imgEye, LEFT, RIGHT));
075:
076:                c.gridwidth = 1;
077:                c.anchor = GridBagConstraints.EAST;
078:                panel.add(new WingLabel("password"), c);
079:                c.anchor = GridBagConstraints.WEST;
080:                c.gridwidth = GridBagConstraints.REMAINDER;
081:                panel.add(tf = new WingTextField("password", 20), c);
082:                tf.setEcho("*");
083:                tf.addTextListener(owner.eventTracer);
084:                tf.setTooltip(new LabelItem(
085:                        "WingTextField\necho char *\ndefault style" + keys,
086:                        WingSet.imgSilence, LEFT, RIGHT));
087:
088:                c.gridwidth = 1;
089:                c.anchor = GridBagConstraints.EAST;
090:                panel.add(new WingLabel("custom style"), c);
091:                c.anchor = GridBagConstraints.WEST;
092:                c.gridwidth = GridBagConstraints.REMAINDER;
093:                panel.add(tf = new WingTextField("click here ;-)", 13), c);
094:                tf.setStyleId("las_vegas");
095:                tf.addTextListener(owner.eventTracer);
096:                tf.setTooltip(new LabelItem(
097:                        "WingTextField\nstyle: las_vegas (stylesheet wingsetdemo.ini)"
098:                                + keys, WingSet.imgBomb, RIGHT, LEFT));
099:
100:                c.gridwidth = 1;
101:                c.anchor = GridBagConstraints.EAST;
102:                panel.add(new WingLabel("custom TopStyle"), c);
103:                c.anchor = GridBagConstraints.WEST;
104:                panel.add(tf = new WingTextField("custom TopStyle", 15), c);
105:                tf.addTextListener(owner.eventTracer);
106:                c.gridwidth = GridBagConstraints.REMAINDER;
107:                WingButton b;
108:                panel.add(b = new WingButton("TopStyle"), c);
109:                b.setStyleId("vpopup");
110:                b.setFastAction(true);
111:                LabelItem tt;
112:                b
113:                        .setTooltip(tt = new LabelItem(
114:                                "modify TopStyle of this WingTextField\nTopStyle is an extra style overriding stylesheet settings \ndynamically at run time\nclick buttonto change settings",
115:                                WingSet.imgIcon, LEFT, RIGHT));
116:                new TopStyleEditor(b, tf, 20, 21, 24, 21, true);
117:                tf.setTooltip(tt);
118:
119:                c.gridwidth = 1;
120:                c.anchor = GridBagConstraints.EAST;
121:                panel.add(new WingLabel("readonly"), c);
122:                c.anchor = GridBagConstraints.WEST;
123:                c.gridwidth = GridBagConstraints.REMAINDER;
124:                panel.add(tf = new WingTextField("readonly", 20), c);
125:                tf.setEditable(false);
126:                tf.addTextListener(owner.eventTracer);
127:                tf.setTooltip(new LabelItem(
128:                        "readonly WingTextField\ndefault style" + keys,
129:                        WingSet.imgYawn, RIGHT, RIGHT));
130:
131:                c.gridwidth = 1;
132:                c.anchor = GridBagConstraints.EAST;
133:                panel.add(new WingLabel("readonly password"), c);
134:                c.anchor = GridBagConstraints.WEST;
135:                c.gridwidth = GridBagConstraints.REMAINDER;
136:                panel.add(tf = new WingTextField("readonly", 20), c);
137:                tf.setEcho("*");
138:                tf.setEditable(false);
139:                tf.addTextListener(owner.eventTracer);
140:                tf.setTooltip(new LabelItem(
141:                        "readonly WingTextField\necho char *\ndefault style"
142:                                + keys, WingSet.imgTongue, LEFT, LEFT));
143:
144:                c.gridwidth = 1;
145:                c.anchor = GridBagConstraints.EAST;
146:                panel.add(new WingLabel("disabled"), c);
147:                c.anchor = GridBagConstraints.WEST;
148:                c.gridwidth = GridBagConstraints.REMAINDER;
149:                panel.add(tf = new WingTextField("disabled", 20), c);
150:                tf.setEnabled(false);
151:                tf.addTextListener(owner.eventTracer);
152:                tf.setTooltip(new LabelItem(
153:                        "disabled WingTextField\ndefault style" + keys,
154:                        WingSet.imgCrying, LEFT, LEFT));
155:            }
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.