帮忙看个java程序,解释一下(对角线布局)
来源:百度知道 编辑:UC知道 时间:2024/05/05 16:44:17
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
int maxWidth = parent.getWidth()
- (insets.left + insets.right);
int maxHeight = parent.getHeight()
- (insets.top + insets.bottom);
int nComps = parent.getComponentCount();
int previousWidth = 0, previousHeight = 0;
int x = 0, y = insets.top;
int rowh = 0, start = 0;
int xFudge = 0, yFudge = 0;
boolean oneColumn = false;
// Go through the components' sizes, if neither
// preferredLayoutSize nor minimumLayoutSize has
// been called.
if (sizeUnknown) {
setSizes(parent);
}
if (maxWidth <= minWidth) {
oneColumn = true;
}
if (maxWidth != preferredWidth) {
xFudg
Insets insets = parent.getInsets();
int maxWidth = parent.getWidth()
- (insets.left + insets.right);
int maxHeight = parent.getHeight()
- (insets.top + insets.bottom);
int nComps = parent.getComponentCount();
int previousWidth = 0, previousHeight = 0;
int x = 0, y = insets.top;
int rowh = 0, start = 0;
int xFudge = 0, yFudge = 0;
boolean oneColumn = false;
// Go through the components' sizes, if neither
// preferredLayoutSize nor minimumLayoutSize has
// been called.
if (sizeUnknown) {
setSizes(parent);
}
if (maxWidth <= minWidth) {
oneColumn = true;
}
if (maxWidth != preferredWidth) {
xFudg
Java 编程初步 傻瓜书
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159167
数据结与算法 Java语言版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160250
精通JBuilder 2005 中文版 高清PDF+随书光盘
http://bbs.topsage.com/dispbbs_121_172861_1.html
JSF JavaServer Faces in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160229
Spring in Action (第二版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146170
Mann