当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: This article tries to take th
 

 

    摘要:revious articles in this series discussed ways of making development of web services more efficient and the applications themselves highly manageable once deployed. but there is more that developers c......
 ·java multithreading @ jdj    »显示摘要«
    摘要: although java is cross-platform, its performance and quality are greatly influenced by the features of the underlying native platform. since the java language and environment includes concurrency a......


Practical Layout Managers @ JDJ
we can learn a little from the layout managers that ship with the java development kit and a couple of the new layout managers released with the java foundation classes. table 1 gives a quick summary of those managers. pay special attention to the descriptions.

the jfc also introduces the scrollpanelayout and viewportlayout managers, but they are so tightly coupled to their respective jscrollpane and jviewport components that they are virtually useless in other contexts.

youll notice a few things about these: each has a simple purpose, described in a single sentence and easy to understand. none of them use exact positioning so they avoid tight coupling to a given display area. each method has a natural organization behind it, often reflected in a real-life approach. all layout managers have the layout suffix as part of their name.

table 2 covers the implementation of new layout managers. well elaborate on their internal function after a quick look at the layout manager interfaces.

the layoutmanager interface 【推荐阅读:谈谈java的学习方向(转载)

this article tries to take the mystery out of the black art of developing layout managers. much of the coverage in books and magazines typically centers on trying to wrench the complicated gridbaglayout into submission or demonstrates the development of a layout manager with virtually no practical use. in the real world of software engineering, the need for applicable solutions takes precedence. this article will add a trio of reusable classes to your inventory and, hopefully, a few techniques to your personal bag of tricks.

practical layout design

the basic design of a layoutmanager is fairly simple. you need to declare your class as implementing the layoutmanager interface and then implement the following methods: addlayoutcomponent(string, component) removelayoutcomponent(component) layoutcontainer(container) dimension minimumlayoutsize(container) dimension preferredlayoutsize(container) the addlayoutcomponent method is called when you use the add method in your container. typically, the add method has only one parameter, so the addlayoutcomponent method is called with the string set to null. with the borderlayout, the label indicating position is passed using the add method with the s
...   下一页
 ·enterprise strategy with java @ jdj    »显示摘要«
    摘要: increasingly, technologists are asked by strategists to state the capability of java within a distributed component architecture. the larger corporate platform is mixed and the owning, interacting b......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE