网站首页
JSP空间
动态资讯
开源项目
技术文档
资源下载
J2EE资源
客户论坛
在线支付
 
  技术文档>>JAVA>>新手入门>>基础入门>查看文档  
  the model-view-controller architecture     
  文章作者:未知  文章来源:水木森林  
  查看:94次  录入:管理员--2007-11-17  
 

swing uses the model-view-controller architecture (mvc) as the fundamental design behind each of its components. essentially, mvc breaks gui components into three elements. each of these elements plays a crucial role in how the component behaves.

model

the model encompasses the state data for each component. there are different models for different types of components. for example, the model of a scrollbar component might contain information about the current position of its adjustable "thumb," its minimum and maximum values, and the thumb's width (relative to the range of values). a menu, on the other hand, may simply contain a list of the menu items the user can select from. this information remains the same no matter how the component is painted on the screen; model data is always independent of the component's visual representation.

view

the view refers to how you see the component on the screen. for a good example of how views can differ, look at an application window on two different gui platforms. almost all window frames have a title bar spanning the top of the window. however, the title bar may have a close box on the left side (like the mac os platform), or it may have the close box on the right side (as in the windows platform). these are examples of different types of views for the same window object.

controller

the controller is the portion of the user interface that dictates how the component interacts with events. events come in many forms ?e.g., a mouse click, gaining or losing focus, a keyboard event that triggers a specific menu command, or even a directive to repaint part of the screen. the controller decides how each component reacts to the event if it reacts at all.

 
 
上一篇: tomcat连接池的配置    下一篇: 台湾资策会scorm 2004 compliant lms之雏型通过测试(转)
  相关文档
再议jar文件 11-17
实例学习struts 11-16
java中通过emit实现动态类生成 11-16
java对象持久化技术之hibernate入门之一 (1) 11-17
使用开源工具提高j2ee系统的质量 11-17
netbeans 和 jboss 结合使用的入门指南 11-17
第一讲 java语言概述 11-17
java基础:初步探讨java语言类加载机制 11-16
java服务器tomcat 5.5.15 stable发布 11-17
谈谈java语言的接口与类型安全 11-17
servlet 中如何捕获 session 事件 11-17
sun jdk/jre 执行禁止类漏洞 11-17
java.util.list翻译 11-17
优化java性能的几种方法 11-17
java入门笔记4_访问控制和包 11-17
使用技巧:对java编程中的文件操作详解 11-16
java内存泄漏,走开! 11-16
集成ejb和corba/corba客户端访问ejb 11-17
微软.net vs java两军对垒 web服务步履艰难 11-17
如何在java中用rmi来实现远程方法调用 11-16
返回首页 | 关于我们 | J网章程 | JSP空间合租 | 客服中心 | 免责声明 | 常见问题 | 参观机房
本站主机空间代理至厦门市华众网络科技有限公司
《中华人民共和国增值电信业务经营许可证》
编号:闽B2-20050079
@2005-2008福建JSP技术网 版权所有 闽ICP备05000928号
厦门(总部):13616026886 福州:0591-87655121
邮箱:admin@fjjsp.com 站长QQ,点击这里给我发消息