本文整理匯總了Java中com.jgoodies.forms.layout.FormLayout.getConstraints方法的典型用法代碼示例。如果您正苦於以下問題:Java FormLayout.getConstraints方法的具體用法?Java FormLayout.getConstraints怎麽用?Java FormLayout.getConstraints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jgoodies.forms.layout.FormLayout
的用法示例。
在下文中一共展示了FormLayout.getConstraints方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: dumpConstraints
import com.jgoodies.forms.layout.FormLayout; //導入方法依賴的package包/類
/**
* Dumps the component constraints to the console.
*
* @param container the layout container to inspect
*/
public static void dumpConstraints(Container container) {
System.out.println("COMPONENT CONSTRAINTS");
if (!(container.getLayout() instanceof FormLayout)) {
System.out.println("The container's layout is not a FormLayout.");
return;
}
FormLayout layout = (FormLayout) container.getLayout();
int childCount = container.getComponentCount();
for (int i = 0; i < childCount; i++) {
Component child = container.getComponent(i);
CellConstraints cc = layout.getConstraints(child);
String ccString = cc == null
? "no constraints"
: cc.toShortString(layout);
System.out.print(ccString);
System.out.print("; ");
String childType = child.getClass().getName();
System.out.print(childType);
if (child instanceof JLabel) {
JLabel label = (JLabel) child;
System.out.print(" \"" + label.getText() + "\"");
}
if (child.getName() != null) {
System.out.print("; name=");
System.out.print(child.getName());
}
System.out.println();
}
System.out.println();
}