本文整理匯總了Java中javax.swing.border.AbstractBorder.getBorderInsets方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractBorder.getBorderInsets方法的具體用法?Java AbstractBorder.getBorderInsets怎麽用?Java AbstractBorder.getBorderInsets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.border.AbstractBorder
的用法示例。
在下文中一共展示了AbstractBorder.getBorderInsets方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test
import javax.swing.border.AbstractBorder; //導入方法依賴的package包/類
private static void test(AbstractBorder border) {
Insets insets = new Insets(0, 0, 0, 0);
if (insets != border.getBorderInsets(getComponent(border), insets)) {
throw new Error("both instances are differ for " + border.getClass());
}
test(border, insets);
}
示例2: checkInsets
import javax.swing.border.AbstractBorder; //導入方法依賴的package包/類
private void checkInsets(final AbstractBorder border, final Insets testInsets) {
assertEquals(testInsets, border.getBorderInsets(newJComponent()));
assertFalse(border.isBorderOpaque());
Insets insets = new Insets(0, 0, 0, 0);
border.getBorderInsets(newJComponent(), insets);
assertEquals(border.getBorderInsets(newJComponent()), insets);
JComponent button = newJComponent();
assertFalse(border.getBorderInsets(button) == border.getBorderInsets(button));
}
示例3: checkInsets
import javax.swing.border.AbstractBorder; //導入方法依賴的package包/類
private void checkInsets(final AbstractBorder border, final JComponent c) {
Insets ins = new Insets(100, 100, 100, 100);
border.getBorderInsets(c, ins);
assertEquals(border.getBorderInsets(c), ins);
}